Last active
December 16, 2015 11:28
-
-
Save fstamour/5427044 to your computer and use it in GitHub Desktop.
Simple function to skip white spaces in a input stream.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <istream> | |
#include <cctype> | |
void eatSpaces( std::istream& in ) { | |
char c; | |
while( in.good() ) { | |
c = in.peek(); | |
if( !isspace(c) ) | |
break; | |
in.get(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment