You do not have a null line in some lines of files.
But you may have an empty string, i.e. empty line.
You can use for example. std::string.length , or if you like C better, strlen .
The isspace function isspace convenient for checking spaces, but note that for char characters, the argument must be distinguished to an unsigned char , for example, from a cuff,
bool isSpace( char c ) { typedef unsigned char UChar; return bool( ::isspace( UChar( c ) ) ); }
Cheers and hth.,
source share