标签:
#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
标签:
原文地址:http://www.cnblogs.com/wireless-dragon/p/5174860.html