Get the length for wide character string : Wide Character String Length « Wide Character String « C Tutorial






#include <stdio.h>
#include <wchar.h>

int main(void)
{
  wchar_t text[100];

  printf("\nEnter the string to be searched(less than 100 characters):\n");
  fgetws(text, 100, stdin);

 
  text[wcslen(text)-1] = L'\0';

  printf("\nFirst string entered:\n%S\n", text);

}
Enter the string to be searched(less than 100 characters):
asdf

First string entered:
asdf








16.6.Wide Character String Length
16.6.1.Get the length for wide character string