Throwing an exception

Nov 2, 2015 at 12:11am
Solved
Last edited on Nov 29, 2015 at 3:50am
Nov 2, 2015 at 12:24am
Have you read the tutorial on exceptions?
http://www.cplusplus.com/doc/tutorial/exceptions/

Nov 2, 2015 at 12:27am
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 Nov 2, 2015 at 12:33am
Nov 2, 2015 at 12:52am
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.

Nov 2, 2015 at 1:04am
Thanks
Topic archived. No new replies allowed.