In C and C++ programs the
function is of type
and therefore it should return an integer value. The return value of the
function is considered the "Exit Status" of the application.
See : http://en.wikipedia.org/wiki/Exit_status
On most operating systems returning 0 is a success status like saying "The program worked fine". In C++ it is optional to type "
" at the end of the
function and the compiler includes it automatically.
are defined like this :
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
These 2 macros can be used as the argument to the
function declared in
and they can also be used as the return value of the