Arguments for MainThis tip submitted by Sajan on 2010-07-06 11:23:55. It has been viewed 2443 times.
Rating of 5.0 with 8 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!