home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / glibc-1.06 / manual / examples / strncat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-18  |  244 b   |  15 lines

  1. #include <string.h>
  2. #include <stdio.h>
  3.  
  4. #define SIZE 10
  5.  
  6. static char buffer[SIZE];
  7.  
  8. main ()
  9. {
  10.   strncpy (buffer, "hello", SIZE);
  11.   printf ("%s\n", buffer);
  12.   strncat (buffer, ", world", SIZE - strlen (buffer) - 1);
  13.   printf ("%s\n", buffer);
  14. }
  15.