strcpy.c (333B)
1 #include "../stdint.h" 2 3 char *strcpy (const char *src, char *dest) { 4 char *init_p = dest; // keep pointing to first character at memory address 5 6 while (1) { 7 *dest = *src; 8 9 if (*src == '\0') { 10 break; 11 } 12 13 src++; dest++; 14 15 } 16 17 return init_p; // just return the initial pointer 18 }