Click for Table of Contents
A Book and Reference Collection
Table of Contents
The C Primer
Copyright © 2024
Rance D. Necaise
⮈  Prev6.5 Standard I/O
Chapter 6. Working with Files
Next  ⮊Exercises

6.6 Binary Files

A binary file contains a sequence of binary numbers representing data values as they would be stored in the computer's memory. For example, if we want to store the value 12 in a binary file, it would be written as a binary value using 4-bytes or 32 bits,

00000000000000000000000000001100

the same as it would be stored in memory. In a text file, the ASCII code 52 would be stored in the text file to represent the number 4.

Examples of binary files include those created by word processors, spreadsheet applications, and databases. Binary files cannot be read and displayed in text editors since they contain byte values outside the printable range.

⮈  Prev Next  ⮊