why does the execution of a c++ program start with main()???
Answer Posted / ajaykumar(me-tu)
I agree with above answer(given by Sujith). It is not
necessary the execution of program always start with main
function. Using pragma startup directive we execute any
function before executing main function. Here we give one
example in c language.
#include<stdio.h>
void print()
{
printf("\nThis is print function");
}
#pragma startup print
void main()
{
printf("\nThis is main function");
}
Output:
This is print function
This is main function
| Is This Answer Correct ? | 9 Yes | 4 No |
Post New Answer View All Answers
Can we use stl in coding interviews?
How do I convert a stl file?
How do you convert stl to steps?
What are the components of stl?
What is a standard template library (stl)? What are the various types of stl containers?
How stl is different from the c++ standard library?
What is the use of stl?
a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.
how to making game in c++ ?
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
In what scenario does the Logical file and Physical file being used?
What is stl in c++ with example?
What is a standard template library (stl)?
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
How is stl different from c++ standard library?