O'Reilly logo

Beginning C: From Novice to Professional, Fourth Edition by Ivor Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX DInput and Output Format Specifications

This appendix summarizes all the format specifications you have available for stream input and output. You use these with the standard streams stdin, stdout, and stderr, as well as text file streams.

Output Format Specifications

There are three standard library functions for formatted output: the printf() that writes to the standard output stream stdout (which by default is the command line), the sprintf() function that writes to a string, and the fprintf() function that writes to a file. These functions have the following form:

int printf(const char* format_string, . . .); int sprintf(char* source_string, const char* format_string, . . .); int fprintf(FILE* file_stream, const char* format_string, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required