Ok so I'm reading from a CSV file and I have been reading the data with the getline function, I've converted the first three "strings" into integers which are person.year, person.month, and person.day. Now I need to convert a string into an array of characters for person.name but don't know how to do so.
-- c++ does not allow variables as array sizes, they must be compile time constants.
strcpy function does return a value but its nothing you want right now. just treat it for now as if it were
void strcpy(char* destination, char* source);
or, as I said,
strcpy(person.name, input.c_str());
but again, you are better off all around just reading it directly.
getline(file, person.name, ',');
^^^
the above getline avoids using C string routines, which are frowned upon in c++
it avoids a useless copy, which consumes resources for no reason (tiny as it may be, try to be in the habit of not doing pointless data copies as those are one of the top 5 or so reasons for slow programs).
let me be very, very clear this time.
getline(file, person.name, ','); <--------------------- this is the line you want!