I tried your method but still couldn't get it to work. I included the newline character search and making it a null terminator. Here is what I have now:

Code:
char *t;
char word[256]; // user entered search word
char temp[256]; // text from file
int found = 0;

printf("Enter a string to search : ");
fgets(word, sizeof(word), stdin);

find = strchr(word, '\n');

if (find) {
   *find = '\0';
}   
                
t = temp;

while ((t = strstr(t, word)) != NULL) {
                      t += strlen(word);
                      found++;
}         

printf("\n\nThe string %s appeared %d times in the file", word, found);
The main problem now is the count equals zero for every search I make which is totally wrong.