The wcslen() function is defined in cwchar.h header file. The function wcslen() function returns the length of the given wide string.
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.
Below programs illustrate the above function:-
The length of 'geeks' is =5
The length of 'A computer science portal for geeks' is =35
- Can we call an undeclared function in C++?
- Can we use function on left side of an expression in C and C++?
- Declare a C/C++ function returning pointer to array of integer pointers
- Function overloading and return type
- Default arguments and virtual function
- Function overloading and const keyword
- How to measure time taken by a function in C?
- Comparator function of qsort() in C
- Can we access private data members of a class without using a member or a friend function?
- Function Overloading and float in C++
- Extra brackets with function names in C/C++
- Function Interposition in C with an example of user defined malloc()
- A C/C++ Function Call Puzzle
- std::tuple, std::pair | Returning multiple values from a function using Tuple and Pair in C++
- Bind function and placeholders in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.