The exit function (defined in the header file stdlib.h) is used to terminate the running program with a specific exit code. It takes the following form:
The exit-code is used by the operating systems and may also be used by the calling program. By convention, an exit-code of 0 indicates a normal exit where as any other value indicates an abnormal exit or an error. If a program is to be terminated before the return 0; statement in within the main function following code can be used:
exit (0);
exit (int exit-code)
The exit-code is used by the operating systems and may also be used by the calling program. By convention, an exit-code of 0 indicates a normal exit where as any other value indicates an abnormal exit or an error. If a program is to be terminated before the return 0; statement in within the main function following code can be used:
exit (0);
No comments:
Post a Comment