What is wrong with that code?
It executes else() but wont execute if(). It just hangs.
Code:#include <iostream> #include <cctype> using namespace std; int main() { char x; for (;;) { cout << "Type a character: " << endl; cin >> x; if( isspace(x) ) { cout << "It's a space." << endl; } else { cout << "It's not a space." << endl; } } }