glibc/manual/examples/strncat.c

15 lines
224 B
C
Raw Normal View History

1995-02-18 01:27:10 +00:00
#include <string.h>
#include <stdio.h>
#define SIZE 10
static char buffer[SIZE];
main ()
{
strncpy (buffer, "hello", SIZE);
puts (buffer);
strncat (buffer, ", world", SIZE - strlen (buffer) - 1);
puts (buffer);
}