main( )
{ char s1[ ]=“copy string”, s2[30];
char *p1=s1, *p2=s2;
int i;
for ( ; *p1!=‘\0’; p1++,p2++) *p2=*p1;
*p2=‘\0’;
printf(“string s2=”);
for (i=0; s2[i]!=‘\0’; i++) printf(“%c”, s2[i]); printf(“\n”); } 程序运行结果为: string s2=Copy string
main( )
{ char s1[ ]=“copy string”, s2[30];
char *p1=s1, *p2=s2;
int i;
for ( ; *p1!=‘\0’; p1++,p2++) *p2=*p1;
*p2=‘\0’;
printf(“string s2=”);
for (i=0; s2[i]!=‘\0’; i++) printf(“%c”, s2[i]); printf(“\n”); } 程序运行结果为: string s2=Copy string