Loading the whole file into memory is unnecessary and inefficient. Try something like this:
FILE *fl;
int cc = getc(fl);
while (cc != EOF)
{
if (cc=='a')
{
cc = getc(fl);
if (cc=='b')
{
cc = getc(fl);
if (cc=='c')
return "FOUND";
}
}
cc = getc(fl);
}
return "NOT FOUND";
Obviously you would never actually use code like this. You should write a function that takes an arbitrary string to search for, but the algorithm is basically the same. Also the I/O will be buffered by the system so you shouldn't have to worry about efficiency of reading a single character at a time. Also I didn't include any error checking.