分类: LINUX
2011-02-07 10:24:38
#include
#include
extern char **environ;
int main(int argc, char *argv[])
{
char **p = environ;
while (*p != NULL)
{
printf("%s (%p)\n", *p, *p);
*p++;
}
return 0;
}
#include
int main(int argc, char *argv[], char *envp[])
{
char **p = envp;
while (*p != NULL)
{
printf("%s (%p)\n", *p, *p);
*p++;
}
return 0;
}