#include<stdio.h> int main(int argc ,char *argv[],char *envp[]) { printf("### ARGC ###\n%d\n",argc); printf("### ARGV ###\n"); while(*argv) printf("%s\n",*(argv++)); printf("### ENVP ###\n"); while(!(((*envp)[0]==‘P‘)&&((*envp)[1]==‘W‘)&&((*envp)[2]==‘D‘))) *(envp++); printf("%s\n",*envp); return 0; }
程序运行结果!1 ### ARGC ### 2 1 3 ### ARGV ### 4 ./2 5 ### ENVP ### 6 PWD=/home/wangguolong/test/C_language_pointer/process
时间: 2024-10-10 02:53:10