That value is returned to the calling process, which is usually your OS shell.
It typically doesn't mean anything to you. If you are making a program that can be used in shell programs you can indicate the success or failure of your program's function by returning 0 (success) or 1 (failure).
For example, the 'mkdir' shell program will try to make a subdirectory. If it succeeds, its exit code is 0. If the directory already exists (or it fails for any other reason), then its exit code is 1.
That way you can write a shell script that uses the 'mkdir' command and also find out whether it worked or not.
You can think of it this way:
main() is a special function which gets called by whatever process executes your program. Returning zero is just a way to say, "all done, all is well."
This is so common that the C++11 standard does not require it explicitly. You can just write:
and the
return 0;
will be inserted automatically by the compiler.
Hope this helps.