0
I’m kind of new with exceptions treatment, what I wanted to do was read a variable in c++ and in case it’s different from the kind I declared to fall in catch.
int x;
try {
cin >> x;
} catch (...) {
cout << "Tipo errado" << endl;
}
In which the input could be anything from string and such.
And why would you do that? C++ programmers don’t do that? Is there a reason you want to use another language philosophy here?
– Maniero