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
Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister
What are stl algorithms?
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
How stl is different from the c++ standard library?
What do stl stand for?
What two types of containers does the stl provide?
What is meant by stl in c++?
What is a standard template library (stl)?
write a program to convert a decimal number in to its equivalent binary number?
What does stl mean in slang?
What is the use of stl?
Why should a c++ programmer be interested in stl?
Name the different types of stl containers.
What is a list in c++ stl?
In what scenario does the Logical file and Physical file being used?