I am using eclipse in Ubuntu 12.04. I use some exceptions in my program and when they are caught it gives me cout correctly. But the program continues to the end. Is there a way
Some solutions:
use return
from your function (and do that accordingly to your return value) if you're doing this in the main() routine
use exit(n)
where n is the exit code (http://www.cplusplus.com/reference/cstdlib/exit/)
abort()
if that's a critical issue (http://www.cplusplus.com/reference/cstdlib/abort/)
Notice: as noted by James Kanze, exit
and abort
will NOT call the destructors of your local objects. This is worth noticing since you're dealing with classes.