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.

2 comments:

  1. please read the posts named::A common misconception and A question on main.......
    if still you have query then i will explain that.......

    ReplyDelete

Feel free to comment......