Chapter 12. File Input/Output

You will learn about the following in this chapter:

  • Functions

    fopen(), getc(), putc(),
    exit(), fclose()
    fprintf(), fscanf(), fgets(),
    fputs()
    rewind(), fseek(), ftell(),
    fflush()
    fgetpos(), fsetpos(), feof(),
    ferror()
    ungetc(), setvbuf(), fread(),
    

In this chapter, you learn how to process files using C's standard I/O family of functions. You learn about text modes and binary modes, text and binary formats, and buffered and nonbuffered I/O. You practice using functions that can access files both sequentially and randomly.

Files are essential to today's computer systems. They are used to store programs, documents, data, correspondence, forms, graphics, and myriad other kinds of information. As a programmer, you will ...

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.