I’m not sure what compiler your using but the include file ctype.h has a macro called isspace() that can be called on characters , like:
char ch = cin.get()<br />
if ( isspace ( ch ) )<br />
cout << "read a space" ;<br />
The definition is listed as
The isspace() function returns non-zero if its argument is some sort of space (i.e. single space, tab, vertical tab, form feed, carriage return, or newline). Otherwise, zero is returned.