C examples for wchar.h:wcslen
function
<cwchar> <wchar.h>
Get wide string length
size_t wcslen (const wchar_t* wcs);
Parameter | Description |
---|---|
wcs | C wide string. |
The length of C wide string.
#include <stdio.h> #include <wchar.h> int main ()/*from www . j a v a2 s. c o m*/ { wchar_t wsInput[256]; wprintf (L"Enter a sentence: "); fgetws ( wsInput, 256, stdin ); /* includes newline characters */ wprintf (L"You entered %u characters.\n",wcslen(wsInput)); return 0; }