Question: C++ HELP . . Suppose the exception class myException is defined as follows: . class myException { public: myException() { message = myException thrown!; cout

C++ HELP

.

.

Suppose the exception class myException is defined as follows:

.

class myException

{

public:

myException()

{

message = "myException thrown!";

cout << "Immediate attention required!"

<< endl;

}

myException(string msg)

{

message = msg;

cout << "Attention required!" << endl;

}

string what()

{

return message;

}

private:

string message;

}

.

Suppose that in a user program, the catch block has the following form:

catch (myException mE)

{

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

}

.

What output will be produced if the exception is thrown with the default constructor? Also, what output will be produced if the exception is thrown with the constructor with parameters with the following actual parameter? "May Day, May Day"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!