# include # include void main() { char *p1="abc",*p2="ABC",str[50]="xyz"; # include # include void main(){ char *p1="abc",*p2="ABC",str[50]="xyz";strcpy(str+3,p2);strcat(str+2,p1);printf("%s\n",str);}这个str+3

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 13:37:33
# include # include void main() { char *p1=
x)SVK)MIU@3Sr3443 mt ltKM bm**DA@^rA6)0 $t 5 2J4Tc5k_d*&"}* 8l\$| 0\`Q,^ׂI@/Yg3֣Qtk='\6 O6<ٱ]O۞N廟v0jxu@+w=ݰhl }/.z>"vDY\7HD'!E^.t'-8YOIy6g .|N7!/.H̳E/

# include # include void main() { char *p1="abc",*p2="ABC",str[50]="xyz"; # include # include void main(){ char *p1="abc",*p2="ABC",str[50]="xyz";strcpy(str+3,p2);strcat(str+2,p1);printf("%s\n",str);}这个str+3
# include # include void main() { char *p1="abc",*p2="ABC",str[50]="xyz";
# include
# include
void main()
{ char *p1="abc",*p2="ABC",str[50]="xyz";
strcpy(str+3,p2);
strcat(str+2,p1);
printf("%s\n",str);
}
这个str+3

# include # include void main() { char *p1="abc",*p2="ABC",str[50]="xyz"; # include # include void main(){ char *p1="abc",*p2="ABC",str[50]="xyz";strcpy(str+3,p2);strcat(str+2,p1);printf("%s\n",str);}这个str+3
意思是str[50]="xyz",这个字符数组以首地址为基准向右移动3个位置为空就是z后面的位置,str+2就是向右移动2个位置是z.就是这个意思.
这个问题归结为数组指针的位置,希望你多看看数组指针~