Chapter 9. Standard stream I/O functions

The standard functions for I/O with stdin and stdout are as follows:

The rule for output is always use the simplest method. For example, use putchar('a') instead of puts("a"), and puts("Hi, Bob") instead of printf("Hi, Bob\n"). Using printf() to print a simple string that has no place-holders wastes CPU time, since printf() combs the string for place-holders as it prints. This may or may not be an issue for a particular program, but it's better to form good habits. If you can eliminate complex library functions such as printf() from your code altogether, you'll end up with a smaller executable file.