最終更新日時:
が更新

履歴 編集

function
<cwchar>

std::wmemset

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

関連項目

参照