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

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.

This question has already been answered. Start a new discussion instead.