/* Sample implementations of strcat function */ /* Concatenates s2 onto end of s1, returns s1 */ char* strcat(char* s1, const char* s2) { int i, j; for (i = strlen(s1), j = 0; s2[j] != '\0'; i++, j++) s1[i] = s2[j]; s1[i] = s2[j]; // copy final '\0' from s2 into end of s1 return s1; } //// OR char* strcat(char* s1, const char* s2) { int i, j = 0; i = strlen(s1); while (s2[j] != '\0') { s1[i] = s2[j]; i++; j++; } s1[i] = s2[j]; // final copy of '\0' return s1; }