Mega Code Archive

 
Categories / C++ Tutorial / Exceptions
 

Catch const char str (string) exception

#include <iostream> int main () {   try   {       throw "Out of range";   }   catch (const char * str)   {       std::cout << "Exception: " << str << std::endl;   }   return 0; } Exception: Out of range