One More Example

Let's run one more printing example, one that makes use of some of C's special escape characters. In particular, the program in Listing 3.10 shows how backspace (\b), tab (\t), and carriage return (\r) work. These escape character escape character escape character escape character escape character escape character escape character escape character escape character escape character concepts date from when computers used teletype machines for output and they don't always translate successfully to contemporary graphical interfaces. For example, this listing doesn't work as described on some Macintosh implementations.

Listing 3.10. The escape.c Program
 /* escape.c--uses escape characters */ #include <stdio.h> int main(void) { float ...

Get C Primer Plus, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.