It's been a long time since I coded anything. I'm having problems checking the equalty of a string function within a "while" statement. The loop never seems to evaluate the strstr result.
If I test with an integer value it works so I assume I don't have a brace out of place elsewhere in my code. I'm trying to loop until a predetermined sub string is found.
do
{
fgets( buffer, 255, fptr );
c--; // while statment test
//}while( c>1 ); // until string found
}while( (strstr(buffer, " "))==NULL ); // until string found
I wonder if it's the fegets() that is your problem. It says here http://www.cplusplus.com/reference/clibrary/cstdio/fgets/ that fgets() puts a null character at the end of the string to signal the end of reading. Just do a cout test to see everything that is read into buffer, comment everything else out for a this test. What do you think, worth a shot?