Historically,
- C++ was derived from C.
- In C, everything was an int unless specified otherwise (there was no void), so it was natural for main to return int.
- C programs were originally developed for command line use, and using a command line interpreter which was far more capable 30 years ago than M$ cmd.exe is even today. That command interpreter could easily determine whether the program just ran was a success (or not) from the value returned by main.
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Offline 7,164 posts
since Dec 2005