I have a program that uses class functions to enter and print out info. The problem is with the second function answers(). Here is the whole cpp file. In the answer function I need to use an exception to exit when its the end of an array. I could just be doing it wrong. I used try/catch originally but when I used it, it caught the exception but ended the whole program. Anyone know what I should do?
I need to use an exception to exit when its the end of an array.
Why would you do such abomination?
USe break; to stop loop. Use return; to stop function. You can even use goto to break from several nested loops. But exceptions to do something routine? This is perversion.
whew! thanks I read a little about runtime_error to understand it better (very useful code) so i used it and it worked. Then I fixed my printing function (I was supposed to take a parameter) but now everything is working fine. Thanks!