Implicit Return Statement for main()

In C++, the compiler adds a

return 0;

statement to the main() function of a program if the function returns an int result and does not end with a user return statement.

Examples:

int main() { } // equivalent to:
// int main() { return 0; }

main() { } // equivalent to:
// int main() { return 0; }

If you enable the ANSI Strict setting , the compiler enforces an external int main() function.