-
绝地无双
/*原 串 : Windows Application目标串 : Windows Application请按任意键继续. . .*/#include <stdio.h>#include <stdlib.h>char *strcopy(char ds[], char ss[]) {int i = 0;while(ds[i] = ss[i]) ++i;return ds;}int main() {char s[] = "Windows Application";char d[20];printf("原 串 : %s\n",s);printf("目标串 : %s\n",strcopy(d,s));system("pause");return 0;}
-
眼眸繁星
#include <stdio.h>char* cpystr(char *des, char *res){for(int i= 0; res[i]!='\0'; i++)des[i]= res[i];des[i]= '\0';return des;}int main (void){char d[30], s[]= "12345";cpystr(d, s);puts(d);return 0 ;}
-
一只萌萌小番薯
char* mystrcpy(char* dest, const char* src) {char* tmp = dest;while (*tmp++ = *src++);return dest;}