Live quiz

cpp - Part 91

Question 1 of 25 Hints left: 3
Q1

What will be the output of the following C++ code? #include <iostream> #include <exception> using namespace std; struct MyException : public exception { const char * what () const throw () { return "C++ Exception"; } }; int main() { try { throw MyException(); } catch(MyException& e) { cout << "Exception caught" << std::endl; cout << e.what() << std::endl; } catch(std::exception& e) { } }

  • A
  • B
  • C
  • D