Hello, There's still a thing that confuse me in C++. Specially in that main() function. This is my question.
Does the real world programs written in C++(million lines of codes), omit the main() function?
Then get a C++ compiler. In C++, main returns an int. That's all. Anything else is not C++. Whatever you're using is not a C++ compiler (let me guess - it's something from 20 years ago?).
The C++ standard (the document that tells you what C++ is) makes it very clear. "A program shall contain a global function called main, which is the designated start of the program".
@asdlkjqweo
Hello, There's still a thing that confuse me in C++. Specially in that main() function. This is my question.
Does the real world programs written in C++(million lines of codes), omit the main() function?
When learn C# instead of C++. There is no main function in C#. There is Main.:)
This program compiles without a hitch.
From that, I am now curious if the C++ Applications available in the market use or didn't use the main()for the designated start of the program; and then you Answered No.
A program shall contain a global function called main, which is the designated start of the program".
From what you answered there, so it means that every C++ program must omit main() function. Sorry if I can't really make my Questions clear,but Thanks for the Answers!
Does the real world programs written in C++(million lines of codes), omit the main() function?
Certainly not: one of the programs at my work here is over 100 MLoC, and it has the main() function, it's the usual int main(int argc, char *argv[]) in a C++ source file.