Programming Reference/Librarys
Question & Answer
Q&A is closed
prints formatted output to the screen.
cprintf takes multiple arguments, applies to each of the format specifier contained in the format string, pointed to by
format, and prints the formatted data directly to the current text window on the screen. The number of available format
must match the number of arguments.
For more information on format specifiers, see printf format”.
Depending _directvideo of the global variable, the string is written either directly or through a BIOS call to screen memory.
To contrast to fprintf and printf, not translated cprintf line character (\ n) in the combination of characters carriage
return / line feed (\ r \ n). Tab character (specified with t \) are not expanded to spaces.
Note: Do not use this function in any case in Win32 GUI applications.
#include <conio.h> int main(void) { clrscr(); window(10, 10, 80, 25); cprintf("Hello world\r\n"); getch(); return 0; }
Hello world