CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
What is the purpose of main( ) function?


Category C Interview Questions
Rating (3.0) By 1 users
Added on 7/19/2006
Views 3020
Rate it!
Answers:

main() is the user defined function.

main() is the first function in the program which gets called when the program executes.The startup code contains runmain() function which calls main() function.we can't chage the name of the main() function.



main() is the user defined function . the program execution is always started from main.
it is not possible to write the program without main()



 Posted by: sreelatha    

Contact sreelatha  Contact sreelatha

For C language when the host call a program the address of main is stored and as soon as we give return 0,this is an indication to the host that the program terminated normally.Hence main internally do some system calls to execute the program and returns 0 as it terminate normally or give any number other than ZERO to give signal to the host that it terminated abnormally.



 Posted by: Retheesh G    

Contact Retheesh G  Contact Retheesh G

main() is a special function used by c program to tell the compiler where program starts and where the program ends.every c program must consist of one main() function.

if you use more than one main(),the compiler doesn't know which one indicate starting of c program.



 Posted by: uppala mamatha    

Contact uppala mamatha  Contact uppala mamatha

main() is a special function used by c program to tell the compiler where program starts and where the program ends.Every c program must consist of one main() function.

If you use more than one main(),the compiler doesn't know which one indicate starting of c program.



 Posted by: uppala mamatha    

Contact uppala mamatha  Contact uppala mamatha

main is user define function i.e define by the user and declaration by the Operating system and call by the Operating system.In C language every program compile beginning of the line and run start the main() function.



 Posted by: prem kumar    

Contact prem kumar  Contact prem kumar


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
why n++ executes faster than n+1?


View Answer
What is the difference between a string and an array?


View Answer
Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?


View Answer
Can the sizeof operator be used to tell the size of an array passed to a function?


View Answer
Is using exit() the same as using return?


View Answer
Is it possible to execute code even after the program exits the main() function?


View Answer
What is a static function?


View Answer
How do you print an address?


View Answer
What is the difference between NULL and NUL?


View Answer
What is the stack?


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6075/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.66