devxlogo

Standard Exit Codes

Standard Exit Codes

C++ defines the symbolic constants EXIT_SUCCESS and EXIT_FAILURE that you can use as return codes. These macros are defined in the header file ( in C) as follows:

 #define EXIT_SUCCESS 0#define EXIT_FAILURE 1


You can use these macros as portable exit codes in main(). For example:

 #include #include using namespace std;int main(){ iftsream infile(

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist