O'Reilly logo

C by Nikolaos D. Tselikas, George S. Tselikis

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

Chapter 15

Files

Real-world programs often need to perform access operations on files. This chapter introduces C’s most important library functions designed specifically for use with files. We won’t describe them in full detail, but we’ll give you the material needed in order to perform file operations. In particular, you’ll learn how to open and close a file, as well as how to read and write data in text and binary files.

Files in C

C supports access operations on two kinds of files: text and binary.

A text file consists of one or more lines that contain readable characters according to a standard format, like the ASCII code. Each line ends with special character(s) the operating system uses to indicate the end of line.

In Windows systems, ...

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