You are on page 1of 2

In C programming, there are two main types

of files:Text Files: Text files are human-


readable files that store data in the form of
plain text. Each line in a text file typically
represents a separate record or piece of
information. Text files are commonly used
for storing configuration settings, logs, and
data that can be easily edited using a text
editor. In C, text files are manipulated using
functions like fopen(), fprintf(), fscanf(),
fgets(), and fputs().Binary Files: Binary files
store data in a format that is not human-
readable. Instead of storing characters
directly, binary files store data in a raw,
binary format, making them more efficient
for storing complex data structures. Binary
files are commonly used for storing images,
videos, executables, and other types of data
that do not need to be directly manipulated
by humans. In C, binary files are manipulated
using functions like fopen(), fwrite(), fread(),
and fclose().Understanding the differences
between text and binary files is crucial for
effectively managing and manipulating data
in C programming.

You might also like