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, ...
Get Beginning C: From Novice to Professional, 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.