#include <stdio.h>
#include <stdlib.h>
extern char **environ;
int main()
{
        char **env=environ;
        while(*env)
        {
            printf("%s\n",*env);
            env++;
        
        }
        exit(0);
}

主要是environ变量,定义如下

#include <stdlib>

extern char **environ;

相关文章:

  • 2021-12-15
  • 2022-02-07
  • 2021-09-17
  • 2021-06-22
  • 2021-10-12
  • 2022-03-01
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2021-07-07
  • 2021-12-10
  • 2021-10-07
  • 2021-12-06
相关资源
相似解决方案