Throwing an exception

Solved
Last edited on
Have you read the tutorial on exceptions?
http://www.cplusplus.com/doc/tutorial/exceptions/

Nevermind I think I figured it out.

One question though, how important is the catch function? I managed to do the throw part correctly, but does catch serve any purpose outside of couting a result?
Last edited on
The catch will allow you to set your application up for quitting gracefully. This is important when you have things in memory that needs to be saved to an external source without. It helps you prevent data loss.

If you can handle the error internally and continue execution I would say avoid exceptions because the 'try' block adds significant overheard to your execution.

Thanks
Topic archived. No new replies allowed.