Communicating with Files
Often you need programs that can read information from files or can write results into a file. One such form of program-file communication is file redirection, as you saw in Chapter 8, "Character Input/Output and Redirection." This method is simple but limited. For instance, suppose you want to write an interactive program that asks you for book titles and then saves the complete listing in a file. If you use redirection, as in
books > bklist
Fortunately, C offers more powerful methods of communicating with files. It enables you to open a file ...
Get C Primer Plus®, Third 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.