Binary IO
Binary IO
MSOffice1
Binary Input/Output
Objectives
❏ To understand the differences between text and binary files
❏ To write programs that read, write, and/or append binary files
❏ To be able to detect and take appropriate action when file errors occur
❏ To be able to process files randomly
❏ To be able to create text files from binary files and vice versa
❏ To understand and be able to implement file merges
❏ To understand and be able to implement the classic sequential file update
1
Slide 1
MSOffice1 , 9/20/2005
12/2/2021
Note
Formatted input/output, character input/output, and string
input/output functions can be used only with text files.
2
12/2/2021
3
12/2/2021
Note
Text files store data as a sequence of characters; binary files
store data as they are stored in primary memory.
4
12/2/2021
10
5
12/2/2021
12
6
12/2/2021
13
14
7
12/2/2021
15
16
8
12/2/2021
17
18
9
12/2/2021
19
10
12/2/2021
21
22
11
12/2/2021
23
24
12
12/2/2021
25
13