GeekInterview.com
  I am new, Sign me up!
 
Home C
 

How is the main() function declared?

 
Category: C
Comments (0)


The declaration of main can be done as


int main()


One more declaration that can be taken by main is command line arguments form


int main(int argc, char *argv[]) 


or this can also be written as


int main(argc, argv)
int argc;
char *argv[];


NOTE: It is not possible for one to declare the main() as void. This is because the function main() returns int only and if the function is declared as returning void by statement void main() there is mismatch in declaration and hence it will not work. main() must be declared as returning int which takes the form by int main() or simple main() meaning int value returned.



Read Next: How does the function call within function get evaluated?



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact  

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape