And please don't say it's fscanf() ;P
I'm trying to replace this line:
if ( fscanf(fp, "P%c\n", &ch) != 1 )
If I understand correctly, it tries to read in a char and store it to &ch, only if it's between a 'P' and a '\n'. Is that right? And if it succeeds, it returns 1 (the number of characters it read)?
I'm trying to come up with a C++ version. Is there any easy way to do a formatted read like that? Or do I need to use fstream, operator>>, and nested if statements?