Open In App

wcslen() function in C++ with Examples

Last Updated : 26 Jun, 2023
Comments
Improve
Suggest changes
1 Like
Like
Report

The wcslen() function is defined in cwchar.h header file. The function wcslen() function returns the length of the given wide string. 

Syntax:

size_t wcslen(const wchar_t* str);

Parameter: This method takes a single parameter str which represents the pointer to the wide string whose length is to be calculated. 

Return Value: This function returns the length of wide string.

Time Complexity: O(1)
Auxiliary Space: O(1)

Below programs illustrate the above function:- 

Example 1:- 

Output:
The length of 'geeks' is =5

Example 2:- 

Output:
The length of 'A computer science portal for geeks' is =35

Next Article
Article Tags :
Practice Tags :

Similar Reads