Skip to content

Instantly share code, notes, and snippets.

@fstamour
Last active December 16, 2015 11:28
Show Gist options
  • Save fstamour/5427044 to your computer and use it in GitHub Desktop.
Save fstamour/5427044 to your computer and use it in GitHub Desktop.
Simple function to skip white spaces in a input stream.
#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