69,370
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
#include<stdio.h>
#include<string.h>
int main(int argc, char* argv[])
{
char str[8]="abcdefg";
char *p1,*p2;
p1=(char*)malloc(sizeof(strlen(str)+1));
p2=p1;
int i=3;
while(i<7)
{
*p1++=str[i];
i++;
}
i=0;
while(i<3)
{
*p1++=str[i++];
}
*p1=0;
printf("%s",p2);
return 0;
}
根据你的代码修改的