#include <stdio.h>

char *mystrcat(char *dst, const char *src)
{
   char *start = dst;
   while ( *dst )
   {
      ++dst; /* find the current end of the string */
   }
   while ( *dst++ = *src++ )
      ; /* copy from 'src' up to and including the terminating null character */
   return start;
}

int main (void)
{
   char text[12] = "Hello";
   puts(mystrcat(text, " world"));
   return 0;
}

/* my output
Hello world
*/
1
Contributor
0
Replies
1
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.