This commit is contained in:
2025-09-15 21:12:04 +08:00
commit 3f58f483ff
144 changed files with 5298 additions and 0 deletions

18
we/24-sy-3.c Normal file
View File

@@ -0,0 +1,18 @@
#include <stdlib.h>
#include <string.h>
char *strcpys(char *dest,char *src){
int len1 = strlen(dest);
int len2 = strlen(src);
char *res = (char *)malloc(sizeof(char)*(len1+len2+1));
if(!res){
printf("malloc failed\n");
return NULL;
}
memcpy(res,dest,len1);
memcpy(res+len1,src,len2);
res[len1+len2] = '\0';
free(src);
return res;
}