wcslen - C wchar.h

C examples for wchar.h:wcslen

Type

function

From


<cwchar>
<wchar.h>

Description

Get wide string length

Prototype

size_t wcslen (const wchar_t* wcs);

Parameters

Parameter Description
wcs C wide string.

Return Value

The length of C wide string.

Demo Code


#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;
}

Related Tutorials