# 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="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.就是这个意思.
这个问题归结为数组指针的位置,希望你多看看数组指针~