#include using namespace std; void foo() { throw "*** Hello there"; } void bar() { try { foo(); } catch (const char *msg) { if (msg[0] == '*') cout << "Just a cheery message: " << msg << '\n'; else throw; } } int main() { try { bar(); } catch (...) { cout << "Caught something\n"; } return 0; }