#include <stdio.h>
#define LEN 30
char *my_strcat(char *dest, char *src);
int main(void)
{
char s1[LEN] = "the new c", s2[] = " ide", *p;
p = my_strcat(s1, s2);
puts(p);
return 0;
}
char *my_strcat(char *dest, char *src)
{
int i = 0, j = 0;
while (dest[i] != '\0') i++; // find the end of dest
while ( (dest[i++] = src[j++]) != '\0'); // copy src to dest
return dest;
}
/*
run:
the new c ide
*/