Different Kinds of Files
• Just like variables in a program, the information
in files could represent text (characters) or noncharacter
data (e.g. a set of numerical values).
– Files that are intended to be interpreted as lines of
characters are called text files
– Files that hold non-character data, not broken into
lines, are called binary files
– You handle these two types of files somewhat
differently in C.
– Remember that in reality, all files are represented by
patterns of bits.
• Computer programs often need to work
with files. Common operations include:
– Reading information from existing files (file
input)
– Writing information into new files, or adding to
existing files (file output)
– Finding files
– Examining the properties of files (creation
date, size, etc.)