the same as tiltle. is that exit() just end the function and abort() end the program?
cplusplus.com gives good descriptions of what each function does. exit "cleans up" upon exiting. abort doesn't. Good discussion here.
No.Both abort() and exit() terminate the program and not the function only. Abort() ends the program with "abnormal program termination".It indicates unsuccessful termination of program.
abort() causes a SIGABRT signal, which will then be caught by the appropriate signal handler (which by default usually causes the programme to terminate with an unsuccessful termination code returned to the environment).
exit() terminates the process a bit more carefully. Any functions you registered with the atexit() function get called, streams are closed, temporary files deleted, that sort of thing, and finally a value specified in the function call to exit is returned to the environment.
thanks for everybody