just looking into arguments being passed to main, I understand that
int argc is the number of arguments including argv[0] which is the full
path to the executing program, but what is *envp[]
I know its a pointer, but what to ?????????????????
// example code
// By Adrian Suri
#include <Iostream>
using namespace std;
main(int argc, char *argv[], char *envp[])
{
cout << "number of arguments passed to program " <<endl;
cout<<"Total arguments was " <<argc <<endl;
int i;
for (i=0; i<argc;i++ ) {
cout <<argv[i] <<" =argc[" <<i <<"]" <<endl;
// cout <<envp[i] <<endl;
} /* endfor */
return 0;
}
regards
Adrian Suri
argc only gives you the elements of argv.
Lars