+ 1
Why does the C++ main function return an integer?
return value in C++
4 Answers
+ 2
Thanks..
+ 1
It is a pre-defind status tht is reported from the kernel source, right? If any hacker hack the protected resource kernel and change it to 1-success as well as 0-failed. Then we can say it isn't a bug of Code:Blocks..!
Just my couriousness..?
+ 1
It's something that's reported to whatever executed the program, which most often is the OS, but not always the case. It's just an additional layer of being able to handle errors, more specifically when the program is ending.
0
It's returning an exit status to the OS (or whatever executed the program) to help with reporting error. 0 - success, non-zero - failed.