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

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.

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.


.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.