wcsncpy

Copies wide characters from wstr_2 into wstr_1. The function copies up to a maximum of maxchar characters.

Format

#include  <wchar.h>

wchar_t *wcsncpy  (wchar_t *wstr_1, const wchar_t
                  *wstr_2, size_t maxchar);
Function Variants This function also has variants named _wcsncpy32 and _wcsncpy64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.

Arguments

wstr_1, wstr_2
Pointers to null-terminated wide-character strings.
maxchar
The maximum number of wide characters to copy from wstr_ 2 to wstr_1.

Description

This function copies no more than maxchar characters from wstr_2 to wstr_1. If wstr_2 contains less than maxchar characters, null characters are added to wstr_1 until maxchar characters have been written to wstr_1.

If wstr_2 contains maxchar or more characters, as many characters as possible are copied to wstr_1. The null terminator of wstr_2 is not copied to wstr_1.

See also wcscpy in this section.

Return Values
The address of wstr_ 1


Previous Page | Next Page | Table of Contents | Index