Skip to content

cprintf

Thomas Foster edited this page Apr 15, 2021 · 1 revision

Function   Writes formatted output to the screen.

Syntaxint cprintf(const char *format, ...);

Prototype in   conio.h

Return valuecprintf returns the number of characters output.

See also putch, cputs

Remarks

cprintf accepts a series of arguments, applies to each a format specification contained in the format string pointed to by format, and outputs the formatted data directly to the screen, to the current text window. There must be the same number of format specifications as arguments. For more information, see printf from the C Standard Library.

Example

int value = 110;
cprintf("Decimal value %d is hex: %X, octal: %o, character: %c\n", value, value, value, value);

Header Files

Clone this wiki locally