Wrote strcpy. Not sure if working

This commit is contained in:
Kat R. 2022-10-09 11:48:26 -05:00
parent a06d3c56a8
commit 000f24b79c

15
string/strcpy.c Executable file
View file

@ -0,0 +1,15 @@
#include <string.h>
char * strcpy(char * restrict dest, const char * restrict src) {
char * to = dest;
const char * from = src;
size_t i;
for(i = 0; from[i] != '\0'; i++) {
to[i] = from[i];
}
to[i] = from[i];
return dest;
}