日期:2014-05-16 浏览次数:20772 次
#include <stdio.h>
extern char **environ;
int main(int agrc, char* argv[])
{
int i;
for (i = 0; environ[i] != NULL; i++)
{
printf("%s\n",environ[i]);
}
return 0;
}
#include <iostream>
#include <unistd.h>
int main(int argc, char* const argv[])
{
int i;
extern char* *environ;
for (i = 0; environ[i] != NULL; ++ i)
{
std::cerr << environ[i] << std::endl;
}
return 0;
}