I have a problem...
in attempting to parse a file seperated by nothing more than whitespace i have an issue... I have decided the best way to do this is to tokenise the string i have, so far i have put all my lines into an array (by defining all new entrys in the array via the newline character) So my array may contain 5 entrys as such : (each entry in the array defines the lines in the file)
1)mary julia anne steve
2)alex james david katie
3)omegle yikes craxy horse
4)foo bar foobar matt maximus
5)capital or not smack
As you can see, each entry in the file may contain differing amounts of undefined whitespace... which can be one or more tab spaces, or many regular space characters.
I've considered looping through the string char by char until non whitespace is detected, but this seems ugly...
any help?
Thanks :)
strtok()
should be all you need. It ignores consecutive separators, so you won't get any empty strings – Dave