C Tutorial/Wide Character String/Read Wide Character String
Use wscanf() to read the data, reading the two strings as wide-character strings
<source lang="cpp">#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;
}</source>
wide character:W wword1 = wword2 =