Hi, i am newin this. can you help me on this problem? I am trying to capture a string of data seperated by ":". is this coding correct? else please help.
text of string to capture:
12:Ian Richards:Africa:33 Beach Street:Hervey Bay:465507)4567 8901
34:Yan Li:Secret:13 Mockingbird Lane:Mysteryville:765403)2345 6789
coding:
fscanf(fptr, "%2s %c %[^\:] %c %[^\:]%*[^\:]%*c %c %[^\:] %c %[^\:] %c %[^\n]\n", newPtr->id,o, newPtr->name,o, newPtr->password,o, newPtr->address,o, newPtr->code,o, newPtr->phone);
o is use to capture the ":".
please help.
text of string to capture:
12:Ian Richards:Africa:33 Beach Street:Hervey Bay:465507)4567 8901
34:Yan Li:Secret:13 Mockingbird Lane:Mysteryville:765403)2345 6789
coding:
fscanf(fptr, "%2s %c %[^\:] %c %[^\:]%*[^\:]%*c %c %[^\:] %c %[^\:] %c %[^\n]\n", newPtr->id,o, newPtr->name,o, newPtr->password,o, newPtr->address,o, newPtr->code,o, newPtr->phone);
o is use to capture the ":".
please help.