I almost never (code in a)
return 0;
at the end of main ...
IN a C++ program
Wheres as,
IN C ...
one ALWAYS needs to return an int value in main, and to code that in explicitly, if the compiler conforms to any standard from C89/C90 forward ...
BUT ...
in C++,
with every standard C++ (since at least C++98? ... maybe earlier?) ...
the (standard conforming) compiler WILL ALWAYS supply code to return 0 for the program, if the programmer did not code it in ...
This is similar to how the C++ compiler will always supply code for a default ctor... if NO ctors were coded in a class ... or a struct ... in C++
So, please feel very comfortable NOT being concerned about the programmer adding code,
return 0;
at the end of main, in a C++ program, because the compiler will then always code it in for you.
The only place(s) where you may need to code return 0 (or some other int value) ...
IS ...
if you are returning from some other place(s) BEFORE the end of main is reached.
Please note also, a trend in C++ ...
with C++11 to C++14 ...
it seems to be the trend to have the compiler DO MORE (behind the scenes) supplying code ...
so that the programmer can do less mundane typing ... just to do various routine jobs ...
for example:
for( auto item : someCppContainer ) cout << item << endl;