Arguments for MainThis tip submitted by Sajan on 2010-07-06 11:23:55. It has been viewed 3398 times.
Rating of 6.7 with 13 votes
On Windows and Unix, the main function can actually accept 3 parameter! Third parameter, envp, is an array of environment variables:
int main(int argc, char **argv, char **envp);
On OS X, there is a fourth argument that supplies arbitrary information from the OS (such as the program path):
int main(int argc, char **argv, char **envp, char **apple);
Help your fellow programmers! Add a tip!