How do I return a text string and a numerical value to an array? At the moment I'm just printing them out, code as follows,
I want to store phrase and count in an array. phrase is a char array and count is an integer. I want to return it before it is reset to 0. Any help please...
Code:
while(fgets(fname, 100, file) != NULL)
{
ffp=fopen(fname, " ");
while(fgets(phrase, 100, ffp))
{
if(strstr(phrase, query) != NULL)
{
count++;
}
fclose(ffp);
printf("%s\n","%d\n", phrase, count);
count=0;
}
}