Mega Code Archive

 
Categories / C++ / Language
 

Catch char pointer type exception

#include <iostream> using namespace std; void XHandler(void)  {    try {       throw "hello";     }    catch(char *) {       cout << "Caught char * inside XHandler." << endl;       throw;     }  } int main(void)  {    cout << "Start: " << endl;    try {       XHandler();     }    catch(char *)     {       cout << "Caught char * inside main." << endl;     }    cout << "End";      }