30
CHAPTER 4 Program Reference for the Standard I/O Library
4.3
Standard I/O Function Interface Printf
Outputs a character string to the standard output device in accordance with the
specified format.
■
Printf
[
Interface
]
Format
int chrcnt = printf(B *format [,data1 [,data2 ...]]);
Parameters
format
:Pointer to the output format string
data1, ...
:Output data
Return parameter chrcnt
:Number of characters output
[
Description
]
Outputs a character string to the standard output device in accordance with the specified format.
The control specifiers in the output format string specify the type and output format of the
parameters following the format parameter. Characters other than control specifiers in the format
are output directly to the standard I/O device. Control specifiers start with the percent (%)
character and specify the format as follows.
%[control][field][l]type
❍
control:... A control character that specifies the output format. The following can be
specified.
❍
field ........ A numeric value that specifies the number of characters to output in the
output data. The output data is not truncated if it requires more than the
specified number of characters. If the number starts with a zero (0), the
leading spaces of the output data are filled with zeros.
If the number of output characters is omitted, the output data is output in the
required number of characters.
❍
l.............. Indicates that the type of the corresponding data is long (4-byte data). Such
data must be pushed onto the stack as four bytes (for a C program, the data
type must be long). If omitted, the stack data is treated as 2-byte data.
❍
type........ A control character that specifies the type of the output data. The following
types are available.
Control
Character
Format
Processing When Omitted
-
+
#
Left justify
Output the sign
Output the radix
Add leading spaces
Right justify
No sign
No radix
No leading spaces
]
*
Содержание F2MC-16L Series
Страница 2: ... ...
Страница 4: ... ...
Страница 10: ...vi ...
Страница 12: ...viii ...
Страница 44: ...32 CHAPTER 4 Program Reference for the Standard I O Library ...
Страница 53: ...41 APPENDIX B Running the Sample System Figure Be Project Member List ...
Страница 54: ...42 APPENDIX Figure Bf Set Configuration File Dialog Box ...
Страница 64: ...52 APPENDIX Figure Cb Sample System Memory Map Continued ...
Страница 65: ...53 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 68: ... ...