Binary Files (Raw Bytes)
Explore how to handle binary files in C by reading and writing raw bytes using fread and fwrite. Understand the benefits of binary files over text and practice with examples to manipulate non-text data efficiently.
We'll cover the following...
We'll cover the following...
There are many circumstances in which you may want to read from and write to binary files. Binary files are not plain text (ASCII) files where each chunk of bytes represents an ASCII character. In binary files, you store raw bytes, in whatever format you want.
Advantages of binary files over ASCII files are as follows:
- They are typically smaller in size.
- They can be read from and written to