Difference between revisions of "cpp/string/wide/wcslen"
From cppreference.com
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh) |
m (Shorten template names. Use {{lc}} where appropriate.) |
||
Line 7: | Line 7: | ||
Returns the length of a wide string, that is the number of non-null wide characters that precede the terminating null wide character. | Returns the length of a wide string, that is the number of non-null wide characters that precede the terminating null wide character. | ||
===Parameters=== | ===Parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par |str | pointer to the null-terminated wide string to be examined}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 30: | Line 30: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc see c | c/string/wide/wcslen}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/string/wide/wcslen]] | [[de:cpp/string/wide/wcslen]] |
Revision as of 19:58, 31 May 2013
Defined in header <cwchar>
|
||
std::size_t wcslen( const wchar_t *str ); |
||
Returns the length of a wide string, that is the number of non-null wide characters that precede the terminating null wide character.
Contents |
Parameters
str | - | pointer to the null-terminated wide string to be examined |
Return value
The length of the null-terminated wide string str
.
Example
Run this code
#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'; }
Output:
The length of L"Hello, world!" is 13
See also
C documentation for wcslen
|