exit Function
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at exit Function.
The exit function, declared in the standard include file STDLIB.H, terminates a C++ program.
The value supplied as an argument to exit is returned to the operating system as the program's return code or exit code. By convention, a return code of zero means that the program completed successfully.
You can use the constants |
Issuing a return statement from the main function is equivalent to calling the exit function with the return value as its argument.
For more information, see exit in the Run-Time Library Reference.