0

IF i write to file REGISTRATION NUMBER :1001 how can read back from the file the 1001.

Thank you for all your help,i have gotten other hints but they don't seem to work

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by jephthah
1

IF i write to file REGISTRATION NUMBER :1001 how can read back from the file the 1001.

Thank you for all your help,i have gotten other hints but they don't seem to work

Well lets see what you've done with some of your hints.

Edited by gerard4143: n/a

0

here's a hint. you can use the function strstr, in a manner similar to this:

result_ptr = strstr(registrationString,":")
printf("the registration number is %s\n",(result_ptr + 1));

EDIT: I just noticed your other thread. People here (including me) are very cautious about people coming here wanting work done for them. I dont think you're really trying that, and even if you were i'm not doing your homework with this answer. my code snippet is not a suitable solution, but only illustrates the concept.

i could have pointed you to an entry for "strstr()" function at any C library reference site, but i think we want daniweb to be a little bit more than just a redirection service.

at any rate, the example i provided isnt much different than one found in any reference.


.

Edited by jephthah: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.