mb650cd
asked on
Exception Handling in C++
I have to write an exception class that will output a different message for each different situation, how do I even start writing an exception class. Please help. Thanks
mb
mb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mb650cd,
Please wrap up this question; you have had sufficient time to evaluate these comments.
Please wrap up this question; you have had sufficient time to evaluate these comments.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: n_fortynine
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Tinchos
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: n_fortynine
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Tinchos
EE Cleanup Volunteer
InvalidDigit::InvalidDigit
{ msg = "That is not a valid digit.\n"; }
Then, in your code you could have
if(!(isdigit(n)))
throw InvalidDigit();
Hope this helps!
~PerlChaser~