Hi, I can't seem to be able to figure out why this code:
doesn't show me that it found the first searchword.Code:char c[100]; char buf[32]; ... if (fgets(buf, sizeof(buf), stdin)!= NULL) while (fgets(c, sizeof(buf), file)!= NULL) if (strstr(c, buf)!= NULL) printf("searchword found!\n"); ...
It works but it should find 6 but only shows up 5 "searchword found".
Can anyone give me some tips?