0

the same as tiltle. is that exit() just end the function and abort() end the program?

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by dspjm
0

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.

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.