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

Send formatted wide character text to a standard output.
Compatibility:
This function is compatible with the following targets:
Prototype:
#include <wchar.h>
int wprintf(const wchar_t * format, ...);
Parameters:
Parameters for this function are:
Remarks:
Performs the same task as printf for a wide character type.
Return:
Returns the number of arguments written or a negative number if an error occurs.
Length Modifiers And Conversion Specifiers For Formatted Output Functions:
Modifier
|
Description
|
|
Size
|
h
|
The h flag followed by d, i, o, u, x, or X conversion specifier indicates that the corresponding argument is a short int or unsigned short int.
|
l
|
The lower case L followed by d, i, o, u, x, or X conversion specifier indicates the argument is a long int or unsigned long int.
The lower case L followed by a c conversion specifier, it indicates that the argument is of type wint_t.
The lower case L followed by an s conversion specifier, it indicates that the argument is of type wchar_t.
|
ll
|
The double l followed by d, i, o, u, x, or X conversion specifier indicates the argument is a long long or unsigned long long
|
L
|
The upper case L followed by e, E, f, g, or G conversion specifier indicates a 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: A 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: A vector int, vector unsigned int or vector bool int when followed by c, d, i, o, u, x or X
|
|
Flags
|
-
|
The conversion will be left justified.
|
+
|
The conversion, if numeric, will be prefixed with a sign
(+ or -). By default, only negative numeric values are prefixed with a minus sign (-).
|
space
|
If the first character of the conversion is not a sign character, it is prefixed with a space. Because the plus sign flag character (+) always prefixes a numeric value with a sign, the space flag has no effect when combined with the plus flag.
|
#
|
For c, d, i, and u conversion types, the # flag has no effect. For s conversion types, a pointer to a Pascal string, is output as a character string. For o conversion types, the # flag prefixes the conversion with a 0. For x conversion types with this flag, the conversion is prefixed with a 0x. For e, E, f, g, and G conversions, the # flag forces a decimal point in the output. For g and G conversions with this flag, trailing zeroes after the decimal point are not removed.
|
0
|
This flag pads zeroes on the left of the conversion. It applies to d, i, o, u, x, X, e, E, f, g, and G conversion types. The leading zeroes follow sign and base indication characters, replacing what would normally be space characters. The minus sign flag character overrides the 0 flag character. The 0 flag is ignored when used with a precision width for d, i , o, u, x, and X conversion types.
|
@
|
AltiVec This flag indicates a pointer to a string specified by an argument. This string will be used as a separator for vector elements.
|
|
Conversions
|
d
|
The corresponding argument is converted to a signed decimal.
|
i
|
The corresponding argument is converted to a signed decimal.
|
o
|
The argument is converted to an unsigned octal.
|
u
|
The argument is converted to an unsigned decimal.
|
x, X
|
The argument is converted to an unsigned hexadecimal. The x conversion type uses lowercase letters (abcdef) while X uses uppercase letters (ABCDEF).
|
n
|
This conversion type stores the number of items output by printf() so far. Its corresponding argument must be a pointer to an int.
|
f, F
|
The corresponding floating point argument (float, or double) is printed in decimal notation. The default precision is 6 (6 digits after the decimal point). If the precision width is explicitly 0, the decimal point is not printed.
For the f conversion specifier, a double argument representing infinity produces [-]inf; a double argument representing a NaN (Not a number) produces [-]nan. For the F conversion specifier, [-]INF or [-]NAN are produced instead.
|
e, E
|
The floating point argument (float or double) is output in scientific notation: [-]b.aaae±Eee. There is one digit (b) before the decimal point. Unless indicated by an optional precision width, the default is 6 digits after the decimal point (aaa). If the precision width is 0, no decimal point is output. The exponent (ee) is at least 2 digits long.
The e conversion type uses lowercase e as the exponent prefix. The E conversion type uses uppercase E as the exponent prefix.
|
g, G
|
The g conversion type uses the f or e conversion types and the G conversion type uses the f or E conversion types. Conversion type e (or E) is used only if the converted exponent is less than -4 or greater than the precision width. The precision width indicates the number of significant digits. No decimal point is output if there are no digits following it.
|
c
|
The corresponding argument is output as a character.
|
s
|
If the s format specifier is preceded by an l length modifier, the argument shall be a pointer to the initial element of an array of wchar_t type that is null terminated
If there is no l length modifier present, the argument shall be a pointer to the initial element of a character array containing a multibyte character sequence beginning in the initial shift state..
|
p
|
The corresponding argument is taken to be a pointer. The argument is output using the X conversion type format.
|
|
CodeWarrior Extensions
|
#s
|
The corresponding argument, a pointer to a Pascal string, is output as a character string. A Pascal character string is a length byte followed by the number characters specified in the length byte.
Note: This conversion type is an extension to the ANSI C library but applied in the same manner as for other format variations.
|
See Also:
"Wide Character and Byte Character Stream Orientation"
"printf"
"fwprintf"
[ 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