Write a definition for an exception class, E, that contains an error number and a string type error name. Include a constructor that creates an E object and initializes both members. Provide accessors for both the message and error number.

What will be an ideal response?

```
#include
using namespace std;
class E
{
public:
E(int theError, string theMessage);
string what();
int errorNumber();
private:
int errorNo;
string message;
};

int E::errorNumber()
{
return errorNo;
}
string E::what()
{
return message;
}
E::E(int Err, string Msg) : errorNo(theError),
message(theMessage){/*empty*/}
```

Computer Science & Information Technology

You might also like to view...

________ images are created by pixels placed on a grid or map

Fill in the blank(s) with correct word

Computer Science & Information Technology

A tab leader is used to connect related information and improve readability of a line in a table of contents

Indicate whether the statement is true or false

Computer Science & Information Technology