C语言 point(char*pt); main() {char b[4]={'a','c','s','f'},*pt=b; pt=point(pt); printf("%cpoint(char*pt);main(){char b[4]={'m','n,'o','p'},*pt=b; point(pt);printf("%c\n",*pt);}point(char*p){ p+=3;}输出结果是什么啊? 为什

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 19:32:45
C语言 point(char*pt); main() {char b[4]={'a','c','s','f'},*pt=b; pt=point(pt); printf(
xN@_ebmd;.| 0F 7^ *`[h1ʊWtZD7\L\3{:5wFh&Cxv])5&/Fsd)'gA*XKxx^3͢N}n68U2x>jIڶ:$h ?\ &Cm'&4*Cuk3zJ"S"Oo}e޸OTf3W4iѭD Nԙ]hRLVd:f\WmK2Ԙu -^m0GuWc`\c/k̲Sʸ{W0?k6d3=r nVXsV׮g/eR?iy;/G6Nh`1gMT?ZT"9WŊ

C语言 point(char*pt); main() {char b[4]={'a','c','s','f'},*pt=b; pt=point(pt); printf("%cpoint(char*pt);main(){char b[4]={'m','n,'o','p'},*pt=b; point(pt);printf("%c\n",*pt);}point(char*p){ p+=3;}输出结果是什么啊? 为什
C语言 point(char*pt); main() {char b[4]={'a','c','s','f'},*pt=b; pt=point(pt); printf("%c
point(char*pt);
main()
{char b[4]={'m','n,'o','p'},*pt=b;
point(pt);
printf("%c\n",*pt);
}
point(char*p)
{ p+=3;}
输出结果是什么啊? 为什么不是 p 而是 m 呢?

C语言 point(char*pt); main() {char b[4]={'a','c','s','f'},*pt=b; pt=point(pt); printf("%cpoint(char*pt);main(){char b[4]={'m','n,'o','p'},*pt=b; point(pt);printf("%c\n",*pt);}point(char*p){ p+=3;}输出结果是什么啊? 为什
因为你传递的是指针p的形参,也就是说不是真正的p,所以在函数体内的操作,对函数外不会造成任何影响.要想有所实现,可以做如下修改:
void point(char**pt);
main()
{char b[4]={'m','n','o','p'},*pt=b;
point(&pt);
printf("%c\n",*pt);
}
void point(char**p)
{ (*p)+=3;}