682ですが、
>>685でOKですか?
自分なりに検索しながら考えて、これでいけると思ったのですが、どうも上手くいきません^^);
#include <stdio.h>
#include <string.h>
int main(void)
{
FILE *fp;
char s[256];
char *sp
char str[] = "foo";

if ((fp = fopen("hoge.txt", "r")) == NULL) {
printf("file open error!!\n");
exit(1);
}

while (fgets(s, 256, fp) != NULL) {

sp = strstr(s, str);
if(sp != NULL){
printf("%s\n", s);
}

}
fclose(fp);

return 0;
}