printf

Performs formatted output from the standard output (stdout). See Chapter 2 for information on format specifiers.

Format

#include  <stdio.h>

int printf  (const char *format_spec, . . . );

Arguments

format_spec
Characters to be written literally to the output or converted as specified in the . . . arguments.
. . .
Optional expressions whose resultant types correspond to conversion specifications given in the format specification.

If no conversion specifications are given, you may omit the output sources. Otherwise, the function call must have exactly as many output sources as there are conversion specifications, and the conversion specifications must match the types of the output sources.

Conversion specifications are matched to output sources in left-to- right order. Excess output pointers, if any, are ignored.

Return Values
The number of bytes written. 
Negative value  Indicates that an output error occurred. The function sets errno. For a list of errno values set by this function, see fprintf in this section. 


Previous Page | Next Page | Table of Contents | Index