wcsncpyのヘルプ・マニュアル
日本語 英語
wcsncpy --help
man wcsncpy
WCSNCPY(3) Linux Programmer’s Manual WCSNCPY(3)
名前
wcsncpy - 固定長のワイド文字文字列をコピーする
書式
#include
wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t n);
説明
wcsncpy() 関数は、 strncpy(3) 関数に対応するワイド文字関数である。この
関数は src が指すワイド文字文字列から、終端の L'\0' 文字を含めて最大 n
個 のワイド文字を、dest が指す配列にコピーする。ちょうど n 個のワイド文
字が dest に書き込まれる。 wcslen(src) の長さが n より小さければ 、dest
が 指 す 配 列 の 残 り の ワ イド文字の部分は L'\0' 文字で埋められる。
wcslen(src) の長さが n 以上ならば、dest が指す文字列が L'\0' で終端する
ことはない。
これらの配列は重なってはならない。
プログラマは、少なくとも n 文字のワイド文字が入るだけの領域を dest に対
して確保しなければならない。
返り値
wcsncpy() は dest を返す。
準拠
C99.
関連項目
strncpy(3)
GNU 1999-07-25 WCSNCPY(3)
WCSNCPY(3) Linux Programmer’s Manual WCSNCPY(3)
NAME
wcsncpy - copy a fixed-size string of wide characters
SYNOPSIS
#include
wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t n);
DESCRIPTION
The wcsncpy() function is the wide-character equivalent of the
strncpy(3) function. It copies at most n wide characters from the
wide-character string pointed to by src, including the terminating
L'\0' character, to the array pointed to by dest. Exactly n wide char-
acters are written at dest. If the length wcslen(src) is smaller than
n, the remaining wide characters in the array pointed to by dest are
filled with L'\0' characters. If the length wcslen(src) is greater or
equal to n, the string pointed to by dest will not be L'\0' terminated.
The strings may not overlap.
The programmer must ensure that there is room for at least n wide char-
acters at dest.
RETURN VALUE
wcsncpy() returns dest.
CONFORMING TO
C99.
SEE ALSO
strncpy(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 1999-07-25 WCSNCPY(3)