最終更新日時:
が更新

履歴 編集

function
<cwchar>

std::wcslen

namespace std {
  size_t wcslen(const wchar_t* s);
}

概要

ワイド文字列の長さを取得する。

効果

sが指す文字列の長さを求める。

戻り値

sが指す文字列の、終端のヌル文字より前にある文字の個数を返す。

備考

  • この関数は、C++26からフリースタンディング処理系でも使用できる

#include <cwchar>
#include <iostream>

int main()
{
  std::wcout << std::wcslen(L"hello") << std::endl;
}

出力

5

バージョン

言語

  • C++98

関連項目

参照