C examples for wchar.h:vwscanf
function
<cwchar> <wchar.h>
Read formatted data into variable argument list
int vwscanf ( const wchar_t * format, va_list arg );
Parameter | Description |
---|---|
format | a scanf format string |
arg | a variable arguments |
On success, the function returns the number of items of the argument list successfully filled.
#include <stdio.h> #include <stdarg.h> #include <wchar.h> void GetWideMatches ( const wchar_t * format, ... ) { va_list args;/*from ww w. j ava 2 s.co m*/ va_start (args, format); vwscanf (format, args); va_end (args); } int main () { int val; wchar_t str[100]; wprintf (L"Please enter a number and a word: "); GetWideMatches (L"%d %l[aeiou]", &val, str); wprintf (L"Number read: %d\nFirst vowels read: %ls\n", val, str); return 0; }