home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010018a < prev    next >
Text File  |  1992-08-12  |  330b  |  18 lines

  1.  
  2. Listing 6 -- the file strcat.c
  3.  
  4. /* strcat function */
  5. #include <string.h>
  6.  
  7. char *(strcat)(char *s1, const char *s2)
  8.     {    /* copy char s2[] to end of s1[] */
  9.     char *s;
  10.  
  11.     for (s = s1; *s != '\0'; ++s)
  12.         ;            /* find end of s1[] */
  13.     for (; (*s = *s2) != '\0'; ++s, ++s2)
  14.         ;            /* copy s2[] to end */
  15.     return (s1);
  16.     }
  17.  
  18.