vwscanf - C wchar.h

C examples for wchar.h:vwscanf

Type

function

From


<cwchar>
<wchar.h>

Description

Read formatted data into variable argument list

Prototype

int vwscanf ( const wchar_t * format, va_list arg );

Parameters

Parameter Description
format a scanf format string
arg a variable arguments

Return Value

On success, the function returns the number of items of the argument list successfully filled.

Demo Code


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

Related Tutorials