CHAPTER 8

image

Working with Files

In this chapter, we will explain the following:

  • How to read data from a file
  • How to send output to a file
  • The difference between text files and binary files
  • The difference between internal and external file names
  • fopen and fclose
  • getc and putc
  • feof and ferror
  • fgets and fputs
  • How to write a program to compare two text files
  • How to perform input/output with binary files
  • How to work with a binary file of records
  • What are random access files
  • How to create and retrieve records from random access files
  • What are indexed files
  • How to update a random access file using an index

8.1 Reading Data from a File

Almost anything ...

Get Advanced Topics in C: Core Concepts in Data Structures 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.