I know that the C++ standard says that return 0 is inserted at the end of main() if no return statement is given; however, I often see recently-written, standard-conforming C++ code that explicitly returns 0 at the end of main(). For what reasons would somebody want to explicitly return 0 if it’s automatically done by the compiler?
I know that the C++ standard says that return 0 is inserted at the
Share
Because it just looks weird to not “return” something from a function having a non-void return type (even if the standard says it’s not strictly necessary).