#include <stdio.h>
void main(){
char str1[]="you are beautiful",str2[30],*p1,*p2;
p1=str1;
p2=str2;
while(*p1!='\0'){
*p2=*p1;
*p1++;
*p2++;
}
*p2='\0';
printf("now the str2 is:\n");
puts(str2);
}
#include <stdio.h>
void main(){
char str1[]="you are beautiful",str2[30],*p1,*p2;
p1=str1;
p2=str2;
while(*p1!='\0'){
*p2=*p1;
*p1++;
*p2++;
}
*p2='\0';
printf("now the str2 is:\n");
puts(str2);
}
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。