In this program I am attempting to write a squaring program. The user enters an integer and it squares the number if it is a number greater than 0. I want to learn how to use the exception features in C++, and I have made an attempt on understanding them. I cannot get this code to give me the error message on line 33 when a number less than or equal to 0 is entered. Thanks for your help!
lines 27-30 cannot throw exception at all (because streams do not throw exceprions by default)
line 26 can throw an exception, but there is nothing catching it.
I was going about this all wrong, I created an exception class and called it in my main function. I have figured this one out! thanks for your reply MiiNiPaa