Wednesday, February 23, 2011

what standard says about main function....

Today I am going to talk about the main function declaration in the C standards.
Two C standard-->C89 and C99

Under C89:
main() is accetable..

Under C99 two forms of main are acceptable:
int main (void)
int main (int argc, char *argv[])

Under C89,:
The return statement at the end of main() is required.
whereas under C99:
If no return statement is present, return 0 is implied.