What is the purpose of main( ) function?
By admin on Jan 17, 2007 in C Interview Questions, Technical
The function main( ) invokes other functions within it.It is the first function to be called when the program starts execution. Ø It is the starting function Ø It returns an int value to the environment that called the program Ø Recursive call is allowed for main( ) also. Ø It is a user-defined function Ø Program execution ends when the closing brace of the function main( ) is reached. Ø It has two arguments 1)argument count and 2) argument vector (represents strings passed). Ø Any user-defined name can also be used as parameters for main( ) instead of argc and argv.


