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:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1992-05-18
|
244 b
|
15 lines
#include <string.h>
#include <stdio.h>
#define SIZE 10
static char buffer[SIZE];
main ()
{
strncpy (buffer, "hello", SIZE);
printf ("%s\n", buffer);
strncat (buffer, ", world", SIZE - strlen (buffer) - 1);
printf ("%s\n", buffer);
}