- #include <stdio.h>
- #include <unistd.h>
- int main(int argc, char * argv[])
- {
- int i;
- printf("\n--------------------------\n");
- printf("argc:%d\n",argc);
- for(i=0;i<argc;i++)
- printf("argv[%d]:%s\n", i, argv[i]);
- return 0;
- }
执行:
./callexec hehe en nihao
运行结果:
--------------------------
argc:4
argv[0]:./callexec
argv[1]:hehe
argv[2]:en
argv[3]:nihao
阅读(1005) | 评论(0) | 转发(0) |