C/C

Advertisement


Question
can a C program has only one main() function or more then one main() function?

Answer
Hi dear krishnaveni!

 C Compiler is devised in such a way it will understand only one main() function no matter how big your programme is .The idea behind this is, main() is the entry point for all the c programes..thats why main() function is limited to one .. if there are more than one entry point .. compiler cannot have track of program execution .. may result in crash or even more dangerous operation say memory violation or stack exhaust .hope this will help you

Thanks and Regards
Prince M. Premnath

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.