指针数组使用二维指针访问,跳过函数名自身。
[root@localhost smb1]# cat main.c
#include <stdio.h>
#include <stdlib.h>
int main(int arc, char ** argv)
{
while(*++argv != NULL)
printf("%s\n",*argv);
return EXIT_SUCCESS;
}
[root@localhost smb1]# gcc main.c -o test
[root@localhost smb1]# ./test
[root@localhost smb1]# ./test 1 22 33 44
1
22
33
44
[root@localhost smb1]#
来着《c与指针》