c++ - why is abort method called? -


in following program abort method called when have got applicable catch statement. reason?

#include <iostream> #include <string> using namespace std;  int main() {      try {         cout << "inside try\n";         throw "text";     }     catch (string x) {         cout << "in catch" << x << endl;     }      cout << "done try-catch\n"; } 

when run program first statement inside try displayed , error:

enter image description here

why abort called when handling string exception?

quite simple really!

you threw char const*, not have matching catch it.

did mean throw std::string("...");?


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -