Hello Coders!
Learning some C++ today and I'm getting a little confused. What I think I'm getting is that when a program is executed the OS looks for the main() to know what to do with the program. So I know that every program requires that at least one .cpp file has a main() function.
But what I'm getting confused about is that "return 0 indicates a successful program execution" does this mean that it got through the main() function without any errors? And, my second question what are significant of the two valid versions of the main()? E.g. below
Learning some C++ today and I'm getting a little confused. What I think I'm getting is that when a program is executed the OS looks for the main() to know what to do with the program. So I know that every program requires that at least one .cpp file has a main() function.
But what I'm getting confused about is that "return 0 indicates a successful program execution" does this mean that it got through the main() function without any errors? And, my second question what are significant of the two valid versions of the main()? E.g. below
C++:
|
C++:
|