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(


Share the Post: