So, i`ve been reading a couple of others topics around here, and some of them showed a couple of ideas that i could use to implement the function.
Basic, it`s a function that receives a char* string and a FILE* file, and must return how many times the string appears in the file.
Initially, i put the whole file in a buffer and used strstr()!=NULL to find the string within it, but strstr() just returns ONE pointer to wherever the string is. So, the big question is:
Is there anyway that I can use strstr recursively or, like strtiok, starting from where the last call stopped?
Thanks very much for your help!
P.S.: This program is in pure C, just in case
This post has been edited by ArthurCamara: 01 December 2010 - 06:16 PM