fprintf function — Writes formatted data
int fprintf(FILE* stream, const char* format, . . . )
fprintf function writes
formatted output to
format parameter contains the
formatting information, and the remaining arguments are printed
according to the format. The return value is the number of
characters printed, or a negative value for an error.
printed verbatim except for conversion specifications, which begin
with a percent sign (
conversion specification is made up of the following parts (in
order): flags, field width, precision, size, and conversion
The following are detailed descriptions of the parts of a conversion specification:
The flag characters are optional and can appear in any order. Table 13-5 lists the flag characters and their meanings.
Table 13-5. Formatting flag characters
Left-justified (default is right-justified).
Signed conversions always begin with a sign (default is to use a sign only if the value is negative).
The output is an initial space character if a signed conversion results in an empty string or a string that does not start with a sign character (+ takes precedence over space).
Use an alternate form: insert a
Fields are padded with leading zeros (after the sign or ...