wcpncpy

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

wcpncpy - 固定長のワイド文字文字列をコピーし、その末尾を指すポインターを返す  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <wchar.h>

wchar_t *wcpncpy(size_t n;
                 wchar_t dest[restrict n],
                 const wchar_t *restrict src,
                 size_t n);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

wcpncpy():

    Since glibc 2.10:
        _POSIX_C_SOURCE >= 200809L
    Before glibc 2.10:
        _GNU_SOURCE
 

説明

The wcpncpy() function is the wide-character equivalent of the stpncpy(3) function. It copies at most n wide characters from the wide-character string pointed to by src, including the terminating null wide (L'\0'), to the array pointed to by dest. Exactly n wide characters 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 than or equal to n, the string pointed to by dest will not be L'\0' terminated.

これらの文字列は重なっていてはならない。

プログラマは、少なくとも n 個のワイド文字が入る領域を dest に確保しなければならない。  

返り値

wcpncpy() returns a pointer to one past the last non-null wide character written, that is, dest~+~wcsnlen(src,~n).  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
wcpncpy() Thread safetyMT-Safe
 

標準規格

POSIX.1-2008.  

関連項目

stpncpy(3), wcsncpy(3)


 

Index

名前
ライブラリ
書式
説明
返り値
属性
標準規格
関連項目

This document was created by man2html, using the manual pages.