A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
1st Parameter
Pointer to the null-terminated wide-character string whose length is to be determined.
Read more about parameters of wcslen in parameters section
The wcslenfunction in C language Calculates the length of a wide character string, excluding the null terminator.
wcslen computes the length of the wide character string pointed to by s, excluding the terminating null wide character. It is the wide character equivalent of strlen.
The wcslenfunction takes 1
parameter:
•
const wchar_t * `ws`: Pointer to the null-terminated wide-character string whose length is to be determined.
Calculates the length of the null-terminated wide-character string `ws`, excluding the null terminator. Returns the number of wide characters in the string.
The wcslen function return value :
Returns the number of wide characters in the string pointed to by s
Output
This example demonstrates the basic usage of wcslen to calculate the length of a wide character string.