printf is defined for output to stdout not "output", stdout can be any stream device. Typically, in a system without a display, it is displayed on a serial interface (UART), so that a terminal or terminal emulator (for example, HyperTerminal or TeraTerm) can be used as a display device.
In some development environments, "semi-hosting" is implemented, where stdio, stdin and stderr, and even in some cases the file system is provided by the development host via the debugger interface (JTAG, ICE, SWD, etc.).
Typically, your compiler library will provide you with hooks or stubs so that you can implement drivers for alternative stream input / output devices, so for example, you could implement them so that printf displays on the LCD if your device has one. This is called a "retargeting."
Clifford
source share