最終更新日時:
が更新

履歴 編集

function
<cwchar>

std::wcscat

namespace std {
  wchar_t* wcscat(wchar_t* s1, const wchar_t* s2);
}

概要

ワイド文字列を連結する。

効果

s1が指す文字列の末尾へ、s2が指す文字列を終端のヌル文字を含めて連結する。

戻り値

s1を返す。

備考

  • 連結先の領域は、連結後の文字列全体を格納できる大きさでなければならない
  • 2つの領域が重なっている場合、動作は未定義である
  • この関数は、C++26からフリースタンディング処理系でも使用できる

#include <cwchar>
#include <iostream>

int main()
{
  wchar_t buffer[16] = L"hello";
  std::wcscat(buffer, L" world");

  std::wcout << buffer << std::endl;
}

出力

hello world

バージョン

言語

  • C++98

関連項目

参照