void f(char **p) { char *t; t=(p+=sizeof(int))[-1]; printf("%s\n",t); } main() { char *argv[]={"ab",void f(char **p){char *t;t=(p+=sizeof(int))[-1];printf("%s\n",t);}main(){char *argv[]={"ab","cd","ef","gh","ij","kl"};f(argv);}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/07 18:20:25
voidf(char**p){char*t;t=(p+=sizeof(int))[-1];printf("%s\n",t);}main(){char*argv[]={"ab",voidf(char**

void f(char **p) { char *t; t=(p+=sizeof(int))[-1]; printf("%s\n",t); } main() { char *argv[]={"ab",void f(char **p){char *t;t=(p+=sizeof(int))[-1];printf("%s\n",t);}main(){char *argv[]={"ab","cd","ef","gh","ij","kl"};f(argv);}
void f(char **p) { char *t; t=(p+=sizeof(int))[-1]; printf("%s\n",t); } main() { char *argv[]={"ab",
void f(char **p)
{
char *t;
t=(p+=sizeof(int))[-1];
printf("%s\n",t);
}
main()
{
char *argv[]={"ab","cd","ef","gh","ij","kl"};
f(argv);
}

void f(char **p) { char *t; t=(p+=sizeof(int))[-1]; printf("%s\n",t); } main() { char *argv[]={"ab",void f(char **p){char *t;t=(p+=sizeof(int))[-1];printf("%s\n",t);}main(){char *argv[]={"ab","cd","ef","gh","ij","kl"};f(argv);}
void f(char **p)//
{
char *t;
t=(p+=sizeof(int))[-1];
printf("%s\n",t);
}
main()
{
char *argv[]={"ab","cd","ef","gh","ij","kl"};// 指针数组,数组元素是指向字符串的指针
//argv[0]指向字符串"ab",argv[1]指向字符串"cd" .
f(argv);//调用f函数 传入 指针数组 的数组名,即 指向指针数组中第一个指针元素argv[0]的
//指针,是指向指针的指针(二阶指针)
}
t= (p+=sizeof(int)) [-1];
先看看 () 里面的
p+=sizeof(int)
sizeof(int) 得到int类型数据的占的字节数(win32 下 int 为4字节)
p指向argv[0],p加4后指向argv[4]
即 t = (&argv[4])[ -1]
t = argv[3]
t 指向 "gh"
所以输出 gh