cprintf
Writes formatted output to the screen.
Defined in header <conio.h>
Syntax
#include <conio.h>
int cprintf(const char *format[, argument, ...]);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ |
Remarks
cprintf accepts a series of arguments, applies to each a format specifier contained in the format string pointed to by format, and outputs the formatted data directly to the current text window on the screen. There
See printf for details
must be the same number of format specifiers as arguments.
on format specifiers.
The string is written either directly to screen memory or by way of a BIOS call, depending on the value of the global variable diredvideo.
Unlike fprintf and printf, cprintf does not translate linefeed characters (\n) into carriage-return/linefeed character pairs (\r\n).
Return value
cprintf returns the number of characters output.
See also
Example
#include <conio.h>
int main(void)
{
clrscr0 ; /* clear the screen */
windowdO, 10, 80, 25); /* create a text window */
cprintf ("Hello world\r\n"l /* output some text in the window */
getchO; /* wait for a key */
return 0;
}
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/conio.h/cprintf/
· short form /3.1/cprintf/