Hi,
I am studying C++ atm but I'm a tad stuck on a problem I have:
I am doing a project which requires me to take a strings of varying length from a text file, cut them up and perform various validation checks on them.
For example;
12436jimmylaboffablahblah
would have to be chopped into
12436 | jimmy la boffa | blah blah
I have the necessary structures to store the data, all the functions I need to perform the tests but I cannot for the life of me figure out how to take the string and chop it up into various pieces. :/
I have looked through all the books I have but I have had no luck in finding a potential solution.
I was experimenting with using commands such as :
fin.getline(temp, MAX); //gets the string
drec.number = temp[5];
drec.name = temp[20];
etc...
but I'm pretty sure that this is not correct. Any help would be greatly appreciated.
Thanks,
James