i read the faq, but i dont understand wut int main (int argc, char *argv[]) is
http://faq.cprogramming.com/cgi-bin/...&id=1043284376
thats the faq page for it, but i didnt understand what it meant. ive always used int main(), but my compiler defaults to int main (int argc, char *argv[]). i dont see what the difference is.
Quote:
But what about int main(int argc, char *argv[], char *envp[])
As an extension to the guaranteed standard, an additional parameter to main() can, on some systems, be used to gain access to the environment variables. This is isn't guaranteed to work on all compilers, so use it with care if you want to keep your code portable.
is int main(int argc, char *argv[], char *envp[]) the same thing as (int argc, char *argv[])? thanks for the help
Re: i read the faq, but i dont understand wut int main (int argc, char *argv[]) is
Quote:
Originally posted by Geo-Fry
is int main(int argc, char *argv[], char *envp[]) the same thing as (int argc, char *argv[])? thanks for the help
No. The char* envp[] gives you a little more info. It tells you some information about the environment.
Re: Re: i read the faq, but i dont understand wut int main (int argc, char *argv[]) i
Quote:
Originally posted by golfinguy4
No. The char* envp[] gives you a little more info. It tells you some information about the environment.
Also note that int main(int argc, char *argv[], char *envp[]) is non-standard. If you want environmental variables, use the getenv() function included in stdlib.h, or cstdlib.