|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <wchar.h> | ||
size_t wcslen(constwchar_t*str); | (1) | (since C95) |
| (2) | (since C11) | |
str is a null pointer and returnsstrsz if the null wide character was not found in the firststrsz wide characters ofsrcwcslen_s is only guaranteed to be available if__STDC_LIB_EXT1__ is defined by the implementation and if the user defines__STDC_WANT_LIB_EXT1__ to the integer constant1 before including<stdio.h>..Contents |
| str | - | pointer to the null-terminated wide string to be examined |
| strsz | - | maximum number of wide characters to examine |
str.str on success, zero ifstr is a null pointer,strsz if the null wide character was not found.strnlen_s andwcsnlen_s are the onlybounds-checked functions that do not invoke the runtime constraints handler. They are pure utility functions used to provide limited support for non-null terminated strings.
Output:
without null character: 50with null character: 51
(C11) | returns the length of a given string (function)[edit] |
C++ documentation forwcslen | |