程序如下
#include <stdio.h>#include <string.h>
void fun(char* s2, char* s1, int n){ while(n--) s1++; strcpy(s2,s1);}int main(){ int n; char *s1 = "helloworld"; char s2[10]={0}; printf("please input the number of 'n'(n<10)"); scanf("%d",&n); fun( s2, s1,n); printf("%s\n", s2); return 0;}
我没弄明白while(n--) s1++; strcpy(s2,s1);是怎么实现从第n个字符开始复制的,求解。