The 'standard' declaration of main, should be..
[php]int main( int argc, char *argv[] )[/php]
I tend to use..
[php]int main( int argc, char **argv )[/php]
because of the whole 'array decay to pointer' thing. I don't know, I like pointers.
The return value of main
should be an int, notifying the user/OS whether the program terminated correctly or not (You should return the constants EXIT_FAILURE or EXIT_SUCCESS, as defined in <stdlib.h>)
The first argument to main is the
amount of arguments passed in via the command line, the second argument is a pointer to the array of arguments.
This provides you enough functionality to retrieve information about how the program should run, and notify the OS how the program terminated.
The reason you see a few different declarations, as far as I can tell, is because some compilers aren't as strict. Don't expect your code to be portable if you don't conform to the standard.
