Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/string/wide/wcslen"

From cppreference.com
< cpp‎ | string‎ | wide
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===
{{param list begin}}
+
{{par begin}}
{{param list item |str | pointer to the null-terminated wide string to be examined}}
+
{{par |str | pointer to the null-terminated wide string to be examined}}
{{param list end}}
+
{{par end}}
  
 
===Return value===
 
===Return value===
Line 30: Line 30:
  
 
===See also===
 
===See also===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list see c | c/string/wide/wcslen}}
+
{{dsc see c | c/string/wide/wcslen}}
{{dcl list end}}
+
{{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

#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