[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


wscanf

Reads a wide character formatted text from standard input.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <wchar.h>
int wscanf(const wchar_t * format, ...);
Parameters:

Parameters for this function are:

format  
wchar_t*  
The format string  
....  
 
Variable arguments  

Remarks:

Performs the same task as scanf for a wide character type.

Return:

Returns the number of items successfully read and returns WEOF if a conversion type does not match its argument or and end-of-file is reached.

Length Modifiers And Conversion Specifiers For Formatted Input Functions:

Modifier
Description

Length Specifiers
hh  

The hh flag indicates that the following d, i, o, u, x, X or n conversion specifier applies to an argument that is of type char or unsigned char.

h  
The h flag indicates that the following d, i, o, u, x, X or n conversion specifier applies to an argument that is of type short int or unsigned short int.  
l  
When used with integer conversion specifier, the l flag indicates long int or an unsigned long int type. When used with floating point conversion specifier, the l flag indicates a double.   When used with a c or s conversion specifier, the l flag indicates that the corresponding argument with type pointer to wchar_t.  
ll  
When used with integer conversion specifier, the ll flag indicates that the corresponding argument is of type long long or an unsigned long long.  
L  
The L flag indicates that the corresponding float conversion specifier corresponds to an argument of type long double.  
v  
AltiVec: A vector bool char, vector signed char or vector unsigned char when followed by c, d, i, o, u, x or X   A vector float, when followed by f..  
vh   hv  
AltiVec: vector short, vector unsigned short, vector bool short or vector pixel when followed by c, d, i, o, u, x or X  
vl   lv  
AltiVec: vector long, vector unsigned long or vector bool when followed by c, d, i, o, u, x or X  

Conversion Specifiers
d  
A decimal integer is read.  
i  
A decimal, octal, or hexadecimal integer is read. The integer can be prefixed with a plus or minus sign (+, -), 0 for octal numbers, 0x or 0X for hexadecimal numbers.  
o  
An octal integer is read.  
u  
An unsigned decimal integer is read.  
x, X  
A hexadecimal integer is read.  
e, E, f, g, G  
A floating point number is read. The number can be in plain decimal format (e.g. 3456.483) or in scientific notation   ([-]b.aaadd).  
s  
If the format specifier s is preceded with an l (el) length modifier, then the corresponding argument must be a pointer to an array of wchar_t. This array must be large enough to accept the sequence of wide_characters being read, including the terminating null character, automatically appended.   If there is no preceding l length modifier then the corresponding argument must be an array of characters. The wide-characters read from the input field will be converted to a sequence of multibyte characters before being assigned to this array. That array must be large enough to accept the sequence of multibyte characters including the terminating null character automatically appended.  
c  
A character is read. White space characters are not skipped, but read using this conversion specifier..  
p  
A pointer address is read. The input format should be the same as that output by the p conversion type in printf().  
n  
This conversion type does not read from the input stream but stores the number of characters read in its corresponding argument.  
[scanset]  
Input stream characters are read and filtered determined by the scanset. See "wscanf," for a full description.  

See Also:

"Wide Character and Byte Character Stream Orientation"

"scanf"

"fwscanf"


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000