1 ¶
//strcpy char strcpy(char* dest, char* source) { char* dptr = dest; do { *dptr++ = *(source++); } while (*source); return dest; }
1-2 ¶
//strlen char strlen(char* dest) { int length = 0; for (int i = 0; dest[i] != '\0'; i++) { length++; } return length; }
1-3 ¶
//strcat char* strcat(char* dest, const char* source) { char* tmp = dest; while (*dest) dest++; while (*source != '\0') (*dest++ = *source++); return tmp; }