Use wscanf() to read the data, reading the two strings as wide-character strings : Read Wide Character String « Wide Character String « C Tutorial






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

int main(void)
{
  int SIZE = 20;
  int value_count = 0;
  wchar_t wword1[SIZE];
  wchar_t wword2[SIZE];

  printf("wide character:");

  value_count = wscanf(L"%l[abcdefghijklmnopqrstuvwxyz] %ls",
                          wword1, wword2);

  printf("\nwword1 = %ls   wword2 = %ls\n", wword1, wword2);
  return 0;
}
wide character:W

wword1 =    wword2 =








16.5.Read Wide Character String
16.5.1.Use wscanf() to read the data, reading the two strings as wide-character strings