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
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- 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++
- isalpha() and isdigit() functions in C with cstring examples.
- Pointers in C/C++ with Examples
- strtok() and strtok_r() functions in C with examples
- memset() in C with examples
- Variadic function templates 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 firstname.lastname@example.org. 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.