Mega Code Archive
Categories
/
C++ Tutorial
/
Exceptions
Catch const char str (string) exception
#include
int main () { try { throw "Out of range"; } catch (const char * str) { std::cout << "Exception: " << str << std::endl; } return 0; } Exception: Out of range