T
Tony Johansson
Hello!
I have this class definition DuplicateNumberExceptionand and a main below.
A question about this class DuplicateNumberException is it any advantage to
let this class inherit from
the base class exception or can this class DuplicateNumberExceptionand be a
stand alone class like it is here.
//Tony
class DuplicateNumberException
{
public:
DuplicateNumberException(const string&);
void show();
private:
string reason:
};
I have this main here
int main
{
......
......
......
Student s("John")
try
{
Registrar::instance(),insert(s);
}
catch(DuplicateNumberException& e)
{
// can't open
}
return 0;
}
I have this class definition DuplicateNumberExceptionand and a main below.
A question about this class DuplicateNumberException is it any advantage to
let this class inherit from
the base class exception or can this class DuplicateNumberExceptionand be a
stand alone class like it is here.
//Tony
class DuplicateNumberException
{
public:
DuplicateNumberException(const string&);
void show();
private:
string reason:
};
I have this main here
int main
{
......
......
......
Student s("John")
try
{
Registrar::instance(),insert(s);
}
catch(DuplicateNumberException& e)
{
// can't open
}
return 0;
}