I can\'t seem to figure out why this falls into a loop after getting non-int input. I\'ve tried cin.flush(), which doesn\'t seem to exist, cin.clear(), which seems like it s
It looks like you would be better off with iostream's native exceptions. Enable with
iostream
cin.exceptions( ios::failbit ); try { … } catch( ios_base::failure & ) { cin.clear(); … }
Never, ever throw an an object not derived from std::exception, and especially not a native type like char*.
throw
std::exception
char*