exit is a function defined in cstdlib (stdlib.h) library.
The purpose of exit is to terminate the running program with an specific exit code. Its prototype is:
1 2 3 |
void exit (int exit code); |
The exit code is used by some operating systems and may be used by calling programs. By convention, an exit code of 0 means that the program finished normally and any other value means an error happened.