Some errors, such as a value out of range, might be the result of erroneous user input. If the input is interactive, the program can just prod prompt the user for a more an acceptable value. With other errors, such as a resource allocation failure, the system may have little choice other than to shutdown.
exit()
This is the standard C function The C standard exit()
function is typically used to end a program. It takes one argument, which should be either EXIT_SUCCESS
or EXIT_FAILURE
indicating normal or abnormal termination. It never returns.
...