The first part:
The wide character version of the strlen function is wcslen (wide-character string length: Wide string lengths) and is described in STRING.H (which also describes strlen) and WCHAR.H. The strlen function is described below:
size_t __cdecl strlen (const char *);
The Wcslen function is described as follows:
size_t __cdecl wcslen (const wchar_t *);
At this point we know that to get the length of the wide string can be called
The function returns the number of characters in a string of 6. Keep in mind that after changing to a wide byte, the character length of the string does not change, but the bit group length changes.
All of the C execution-time link library functions that you are familiar with string parameters have a wide character version. For example, wprintf is a wide-character version of printf. These functions are described in WCHAR.H and in the header file that contains the description of the standard function.
Part II:
Explanation of MSDN:
int Lstrlen (LPCTSTR lpstring);
function function: This function returns the number of bytes (ANSI version) or WCHAR value (Unicode version) of the specified string (not including the interrupt character ')
Return value: Returns the length of the specified string when the string is TCHAR. When the ANSI version is the number of bytes. Returns 0 if the string is empty.
size_t strlen (const char *string);
size_t wcslen (const wchar_t *string);
function function: Get the length of the string
Return value: Returns the number of characters in a string
Note: Returns the number of characters in a string that does not contain the string Terminator '. Wcslen is a wide-character version of strlen
Summary:
1. Lstrlen returns the number of characters in a string based on the type of the parameter (if the operating system defines Uincode, it represents a wide character, or ANSI character if undefined)
2, Wcslen returns the number of wide characters
3. Strlen returns the number of ANSI characters
Part III: Strlen and Wcslen return the number of characters, not the number of bytes that the character occupies.
Char, wchar_t, strlen, wcslen