1) Returns the length of a wide string, that is the number of non-null wide characters that precede the terminating null wide character.
2)Same as
(1), except that the function returns zero if
str
is a null pointer and returns
strsz
if the null wide character was not found in the first
strsz
wide characters of
src
wcslen_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 constant 1 before including <stdio.h>..
1) The length of the null-terminated wide string str
.
2) The length of the null-terminated wide string str
on success, zero if str
is a null pointer, strsz
if the null wide character was not found.
strnlen_s
and wcsnlen_s
are the only bounds-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.
#include <wchar.h> #include <stdio.h> int main(void) { wchar_t str[] = L"How many wide characters does this string contain?"; printf("without null character: %zu\n", wcslen(str)); printf("with null character: %zu\n", sizeof str / sizeof *str); }
Output:
without null character: 50 with null character: 51[edit] References
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4