why does the execution of a c++ program start with main()???
Answer Posted / sujith
Typically all programs that is written using C or C++ have
a global header called C Runtime headers. This is inserted
to the beginning of programs. So when you start the program
the function that is called always is, _CRTMain(). This
function will call the main function. Why every function to
start with main? Well, it is not true that all functions
should start with main. There are ways to call a user
defined function before main using #pragma starup etc.
Still mostly the entry point for all functions are main.
The reason why it is given like that is, it is essential
that _CRTMain has to give control to the user defined
functions through some way. Main is that function, and why
it is named as main is because that is the "main" function
which _CRTMain calls.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the stl, standard template library?
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.
please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html
What are the components of stl?
how to use C++?
What does stl mean in slang?
sir please send me bpcl previous question papers
What are the different types of stl containers?
Is stl part of c++ standard?
What are the symptoms of stl?
What is stl stack?
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.
In what scenario does the Logical file and Physical file being used?
How is stl different from c++ standard library?
What is the use of stl?