I want to know how and when can I use the exit() function like the program in my book:
exit()
#include void main() { int goals;
The exit() function is a type of function with a return type without an argument. It's defined by the stdlib header file.
You need to use ( exit(0) or exit(EXIT_SUCCESS)) or (exit(non-zero) or exit(EXIT_FAILURE) ).
( exit(0) or exit(EXIT_SUCCESS))
(exit(non-zero)
exit(EXIT_FAILURE) )