strncpy
Syntax
#include
<string.h)
char
*strncPY(51, 52, n}
char
*sl, *s2;
size-t n;
Defined in
strncpy. c in rts. src
String Copy
Description
The strncpy function copies up to n characters from s2 into s1. If s2 is n
characters long or longer, the null character that terminates s2 is not co-
pied. If you attempt to copy characters from overlapping strings, the func-
tion's behavior is undefined.
If s2 is shorter than n characters, strncpy
appends null characters to s
1
so that s
1
contains n characters. The func-
tion returns the value of s 1.
,
6-76