What\'s the difference between those three, and how shall I end program in case of exception which I can\'t handle properly?
terminate() is automatically called when an exception occurs that cannot be handled. By default, terminate() calls abort(). You can set a custom handle with set_terminate() function.
abort() sends the SIGABRT signal.
exit() is not necessarily a bad thing. It successfully exits the application, and calls atexit() functions in LIFO order. I don't normally see this in C++ applications, however, I do see it in many unix based applications where it sends an exit code at the end. Usually a exit(0) indicates a successful run of the application.