1wcsncpy(3)                 Library Functions Manual                 wcsncpy(3)
2
3
4

NAME

6       wcsncpy - copy a fixed-size string of wide characters
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <wchar.h>
13
14       wchar_t *wcsncpy(wchar_t dest[restrict .n],
15                        const wchar_t src[restrict .n],
16                        size_t n);
17

DESCRIPTION

19       The   wcsncpy()  function  is  the  wide-character  equivalent  of  the
20       strncpy(3) function.  It copies at most  n  wide  characters  from  the
21       wide-character string pointed to by src, including the terminating null
22       wide character (L'\0'), to the array pointed to  by  dest.   Exactly  n
23       wide  characters  are  written  at  dest.  If the length wcslen(src) is
24       smaller than n, the remaining wide characters in the array  pointed  to
25       by  dest  are  filled  with  null  wide  characters.  If the length wc‐
26       slen(src) is greater than or equal to n, the string pointed to by  dest
27       will not be terminated by a null wide character.
28
29       The strings may not overlap.
30
31       The programmer must ensure that there is room for at least n wide char‐
32       acters at dest.
33

RETURN VALUE

35       wcsncpy() returns dest.
36

ATTRIBUTES

38       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
39       tributes(7).
40
41       ┌────────────────────────────────────────────┬───────────────┬─────────┐
42Interface                                   Attribute     Value   
43       ├────────────────────────────────────────────┼───────────────┼─────────┤
44wcsncpy()                                   │ Thread safety │ MT-Safe │
45       └────────────────────────────────────────────┴───────────────┴─────────┘
46

STANDARDS

48       C11, POSIX.1-2008.
49

HISTORY

51       POSIX.1-2001, C99.
52

SEE ALSO

54       strncpy(3)
55
56
57
58Linux man-pages 6.04              2023-03-30                        wcsncpy(3)
Impressum