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

Recommended Answers

All 4 Replies

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.