Possible Duplicate:
What should main() return in C/C++?
In C++, return 0
tells that the program has ended successfuly.
What about return -1
? Does it break (halt) the program?
Possible Duplicate:
What should main() return in C/C++?
In C++, return 0
tells that the program has ended successfuly.
What about return -1
? Does it break (halt) the program?
Short answer: no. Returning anything except 0 just means that there was an error.
No, it just sets the return_code environment variable in the shell, with which you can determine whether the program returned fine or with error when you use batch processing.
Windows:
echo %errorlevel%
POSIX:
echo $?
BTW, use EXIT_SUCCESS and EXIT_FAILURE defined in cstdlib
http://www.boost.org/doc/libs/1_45_0/libs/system/doc/index.html#Acknowledgements
Here you can find nice library for system error types.