Putting strings into an array from a text file.
Hi All,
I have a text file with the following information:
Bloggs,Joe,26-07-82
I want to split this information into different fields, which will be stored in an array.
My first problem is how do I split up the information into seperate fields, such as FirstName, SurName, DOB. I need some method of reading the text untill it gets to the first comma. And then the same again for the second comma etc.
My second problem is how to get the program to read the information on from a text file, perform the string sepperation, described above and put this information into an array.
I have basic knowledge of C but have a firm understanding of the basic concepts.
I have been told that the STRUCT method may be of use. Also the STROK / TOKEN method may be useful for seperating the string.
I would be very gratefull for any help!!!
Cheers
John