The standard says that main
will return 0
if there is no return
statement. From the draft C++ standard section 3.6.1
paragraph 5
:
return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling std::exit with the return value as the argument. If control reaches the end of main without encountering a return statement, the effect is that of executing
return 0;
The C99
draft standard in section 5.1.2.2.3
says:
If the return type of the main function is a type compatible with int, a return from the
initial call to the main function is equivalent to calling the exit function with the value
returned by the main function as its argument;10) reaching the } that terminates the
main function returns a value of 0.
From what I can tell the last version of Turbo C++ is quite old and I can not find anything that defines which standard if any it supports.