You are viewing a single comment's thread. Return to all comments →
instead of using runtime_error, can you throw an int and catch it then cout "n and p should be non-negative"?
How come you don't need a class funtion definition like this?
int Calculator::power(int n, int p)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 17: More Exceptions
You are viewing a single comment's thread. Return to all comments →
instead of using runtime_error, can you throw an int and catch it then cout "n and p should be non-negative"?
How come you don't need a class funtion definition like this?