I’m trying implement reading database records from a txt file feature. I have a file, which has the following:
FirstName LastName Age PhoneNumber (4 strings divided by whitespaces)
I need to read this line, split those 4 strings by whitespaces and add each string to a struct’s char 2d array, which I don’t have a clue how to do. (Also I need to do this for multiple lines, but I hope I’ll figure it on my own)
struct
struct nn{
int NO; // record's number
char params[4][20]; //array where should 4 strings from file go to
};
array for records
struct NN records[NO_OF_RECORDS];//NO_OF_RECORDS is a defined const