Saturday, May 22, 2010

In C, how can I read from a text file and put strings separated by tabs (\t) into a structure array?

Example:


John (\t) Doe (\t) Jr.


Johnny (\t) Doey (\t) Sr.


in an array...


typedef struct person {


name


sname


stitle


} person;





I need to do this in order to alter these strings.

In C, how can I read from a text file and put strings separated by tabs (\t) into a structure array?
Haven't been doing much C lately, but take a look in your standard io (stdio.h) and string (string.h) libraries for functions like fopen, fgets, and strtok...





That should get you going in the right direction.


No comments:

Post a Comment