Many programmers treat the main
function
specially in that they omit the
return type declaration and include no
return statement. Such main
functions are treated by the C++
compiler as though there were an int
type declaration in front of
main
and a return 0;
statement at the end of main
.
The 0
tells the operating system that the program terminated in the
expected way, rather than with some sort of error.
Some C++ compilers issue warnings whenever either the type declaration or the return statement are missing.