Friday, July 31, 2009

I want to know that whether "main" function in 'c' is a predefind function or user defind function ?

main() is a function which must be defined by the programmer. So it is called user defined function. when operating system runs our program, first it calls main() function, and return control to the user. So, main() is pre-identified by the operating system and must be defined by the user.

I want to know that whether "main" function in 'c' is a predefind function or user defind function ?
main function is a userdefined functcion but its prototype is predefined. This function is recognized by C-compiler and code inside this is compiled. Also you can pass argument to main() to send it to command line compilation at DOS prompt.
Reply:Its a predefined function, that returns an integer. You can also make it take command line args.
Reply:The main function is user defined, and must be defined.





You can read more about used defined vs. predefined functions in the excellent book C++ primer plus.





Here is a link to the relavent content from the book on google:





http://books.google.com/books?id=zuyAIZ9...
Reply:main function is an user defined function only ya in c.......


No comments:

Post a Comment