Mike Wahler said:
Open the file with 'fopen()'.
Read each line in the file with 'fgets()'.
For each line read, search for the string with 'strstr()'
OP didn't say that that file is ASCII text file. This approach would
fail for e.g. "xx\0.ABC". This would IMHO require to open file in
binary mode, use fread(), then search "manually" (or use strstr()
"smartly", at the same time count new line "characters" (rather line
terminators? - portability issue), if OP wants to determine line number,
not only "stop at that line". Mac's approach is more workable (though I
hate reading files char at a time - I would "allocate" buffer with size
multiple of file system block size, but I digress, it's OT). And it's all
assuming ASCII encoding of file's content. I wouldn't call all this work
trivial for a newbie (no offense intended). From my limited
knowledge of Standard, I don't see any shortcut(s).