Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

What happens when you attempt to compile and run the following code?

What happens when you attempt to compile and run the following code?

#include

#include

using namespace std;

class myClass : public exception

{

virtual const char* what() const throw()

{

return "My exception.";

}

} obj;

int main () {

try

{

throw obj;

}

catch (exception& e)

{

cout << e.what() << endl;

}

return 0;

}

A.

It prints: My exception.

B.

It prints: 0

C.

It prints: 1

D.

Compilation error

C++ Institute CPA-21-02 Summary

  • Vendor: C++ Institute
  • Product: CPA-21-02
  • Update on: Aug 2, 2025
  • Questions: 257
Price: $52.5  $149.99
Buy Now CPA-21-02 PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method