namespace std {
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
}
概要
指定した文字数のワイド文字を、指定した文字で埋める。
効果
sが指す領域の先頭n文字を、cで埋める。
戻り値
sを返す。
備考
- この関数は、C++26からフリースタンディング処理系でも使用できる
例
#include <cwchar>
#include <iostream>
int main()
{
wchar_t buffer[8] = {};
std::wmemset(buffer, L'x', 5);
std::wcout << buffer << std::endl;
}
出力
xxxxx
バージョン
言語
- C++98
関連項目
std::memset(): バイト単位版
参照
- P2338R4 Freestanding Library: Character primitives and the C library
- C++26で、この関数がフリースタンディング処理系で使用可能になった