Also found in: Wikipedia.


The standard function in the C programming language library for printing formatted output.

The first argument is a format string which may contain ordinary characters which are just printed and "conversion specifications" - sequences beginning with '%' such as %6d which describe how the other arguments should be printed, in this case as a six-character decimal integer padded on the right with spaces.

Possible conversion specifications are d, i or u (decimal integer), o (octal), x, X or p (hexadecimal), f (floating-point), e or E (mantissa and exponent, e.g. 1.23E-22), g or G (f or e format as appropriate to the value printed), c (a single character), s (a string), % (i.e. %% - print a % character). d, i, f, e, g are signed, the rest are unsigned.

The variant fprintf prints to a given output stream and sprintf stores what would be printed in a string variable.

Unix manual page: printf(3).
This article is provided by FOLDOC - Free Online Dictionary of Computing (
References in periodicals archive ?
Taking util.bc in ghttpd-1.4 as an example, printf is called to output i8 * %97, so %97 is part of the security-critical non-control data.
It mixes the "printf" style debug statements with a mixed signal oscilloscope that shows detailed timing of real-time operation of the user's design.
(i) The E16G301 processor does not have direct access to printf function for logging results.
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include "func.c" int main ( ){ int i; int pp [3] = {3, 0, 1}; int p = pp [0] + pp [1] + pp [2]; int nn = 50; double * x_init = (doube *) malloc (p * sizeof (double)); x_init = {5.0, 3.0, 1.0, 2.5}; double *z = (double *) malloc(nn * sizeof (double)); // //////////////////////////////////////////////////////////////////// gen_rpd_z (x_init, pp, nn, z); // //////////////////////////////////////////////////////////////////// for (i = 0; i<nn ; i ++){ printf ("P(%d)=%lf\n", i, z [i]); } return 0; } 3.1.2 PND Reconstruction
printf) and performs type analysis on the arguments to these statements.
The above code cheats slightly by simply calling the C printf function for the bit that actually prints to screen.
i = 0 ; while (i< - 10) { printf ("% 3d %3d \n", i, 50-i) I++; } * Describe 4 types of coupling in software design.
Everyonew antsap ieceo fher, evenif it'so nly fleeting- punters backedherat oddso f1-20inher last twostar tsj ust toh avea souvenir ticket,e venthou ght he printf adesawayaf terthr eey ears.
Unsurprisingly, Zami does not comprise "linear, solid blocks of printf Like Oranges Are Not the Only Fruit, much of the book proceeds via association instead of chronologically: Lorde works with themes rather than timelines.
\n", dDiff); double dOneFile = dDiff / nCount; printf ("Vieno failo laikas %.5f s.
"Unlike a C-language printf function, the write instruction requires little CPU overhead because the CPU does not call a lengthy UART or Ethernet routine to output the register data.