Introduces a do-while loop.
// Gets the next non-whitespace character from standard input.
// Returns EOF at end of input. isspace requires an unsigned char value.
int read_char() {
int c;
do {
c = getchar();
} while (c != EOF && isspace(static_cast<unsigned char>(c)));
return c;
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents