EXIT_SUCCESS, EXIT_FAILURE

From cppreference.com
< cpp‎ | utility‎ | program
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)
 
Program support utilities
Program termination
(C++11)
(C++11)
EXIT_SUCCESSEXIT_FAILURE
Unreachable control flow
Communicating with the environment
Signals
Signal types
Non-local jumps
Types
 
Defined in header <cstdlib>
#define EXIT_SUCCESS /*implementation defined*/
#define EXIT_FAILURE /*implementation defined*/

The EXIT_SUCCESS and EXIT_FAILURE macros expand into integral expressions that can be used as arguments to the std::exit function (and, therefore, as the values to return from the main function), and indicate program execution status.

Constant Explanation
EXIT_SUCCESS successful execution of a program
EXIT_FAILURE unsuccessful execution of a program

Notes

Both EXIT_SUCCESS and the value zero indicate successful program execution status (see std::exit), although it is not required that EXIT_SUCCESS equals zero.

See also