CppProgrammer33,
Tinker with this:
Code:
#include <iostream>
using namespace std;
int main( int argc, char **argv, char **envp )
{
auto int i;
for( i = 0; i < argc; i = i + 1 )
{
cout << "Argument #" << i << ": " << argv[i] << endl;
}
// nullptr is undeclared in g++ (GCC) 3.4.4
// for( i = 0; nullptr != envp[i]; i = i + 1 )
for( i = 0; NULL != envp[i]; i = i + 1 )
{
cout << "Environment variable #" << i << ": " << envp[i] << endl;
}
return 0;
}
I tried using nullptr, but it looks like it's time to upgrade the software. I think that's the full signature for main, in addition to the parameters passed to the program by the OS from the user when it is invoked, there are a collection of environment variables which may also be accessed by the program.
Best Regards,
New Ink -- Henry