O'Reilly logo

Programming in C: A Practical Approach, First Edition by Ajay Mittal

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

10

Files

Learning Objectives

In this chapter, you will learn about:

  • Files

  • C’s approach to perform file input-output

  • Streams

  • How to create, read, write and update files

  • Sequential access files

  • Random access files

10.1 Introduction

In the previous chapters, we have used functions such as scanf and printf to read and write data. These are console input-output (I/O) functions that read data from or write data to the terminal, i.e. keyboard and screen, respectively. The console I/O is preferred in interactive programs where the amount of data in I/O is small. If a program deals with I/O of large volume of data, the console I/O is not convenient and consumes a lot of time. Moreover, the entered data are stored in variables and arrays. These ...

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