Hi.
I am trying to extract a series of strings that are put together in a buffer like this:
David_Smith__monkey___555-1435__555-1323__test.com_
one _ equals one VTAB.
The strings should be inserted in a struct, the struct looks like this:
struct Contact {
char fname[50];
char sname[50];
char nmame[50];
char home[50];
char next[50];
char temp[50];
};
So, Devid should go in fname, Smith in sname, nname should be skipped since there is nothing between the two TABS, etc.
I am stuck so any help would be very appreciated.
/MoonSire



LinkBack URL
About LinkBacks



Then again, you said that empty fields are allowed, so it may be more convenient to manually parse or take advantage of some of the string searching functions in string.h. What have you tried so far?