std::wcslen - cppreference.com
提供: cppreference.com
<tbody> </tbody>
|
|
||
ワイド文字列の長さ、つまり、終端のヌルワイド文字の直前までの非ヌルワイド文字の数を返します。
str の指すワイド文字配列にヌル文字がない場合、動作は未定義です。
引数
| str | - | 調べるヌル終端ワイド文字列を指すポインタ |
戻り値
ヌル終端ワイド文字列 str の長さ。
例
#include <iostream> #include <cwchar> int main() { const wchar_t* str = L"Hello, world!"; std::wcout << "The length of L\"" << str << "\" is " << std::wcslen(str) << '\n'; }
出力:
The length of L"Hello, world!" is 13