#include #include using namespace std; void funk(int i) { try { switch (i) { case 0: throw(0); case 1: throw(string("Have a nice day")); case 2: throw(5); case 3: throw(3.14); } } catch (const string& it) { cout << "You threw me a string: " << it << endl; } catch(const char* it) { cout << "You threw me a const char*: " << it << endl; } catch(double it) { cout << "You threw me a double: " << it << endl; } catch(...) { cout << "You threw me something. I know not what!\n"; } } int main() { funk(1); funk(2); funk(3); funk(0); cout << "End of program\n"; }