c++ - What does throw do when not in used with try and catch? -
what throw
when not used try , catch? like:
if (isempty()) throw "stack empty, cannot delete";
does printed in console?
but when throw
contains int or char arguments, thrown catch; happens in case?
the c++ runtime have along lines of (this not how looks, can think of working way, unless working on special):
void beforemain() { try { int res = main(); exit(res); } catch(...) { cout << "unhandled exception. terminating..." << endl; terminate(); } }
Comments
Post a Comment