7-5 character input/output functions

16
Computer Science: A Structured Programming Approach Using C 1 5 Character Input/Output Functions Character input functions read one character Character input functions read one character at a time from a text stream. Character output at a time from a text stream. Character output functions write one character at the time to a functions write one character at the time to a text stream. text stream. Terminal Character I/O Terminal and File Character I/O Character Input/Output Examples Topics discussed in this section: Topics discussed in this section:

Upload: garrison-meadows

Post on 31-Dec-2015

27 views

Category:

Documents


1 download

DESCRIPTION

7-5 Character Input/Output Functions. Character input functions read one character at a time from a text stream. Character output functions write one character at the time to a text stream. Topics discussed in this section:. Terminal Character I/O Terminal and File Character I/O - PowerPoint PPT Presentation

TRANSCRIPT

Computer Science: A Structured Programming Approach Using C 1

7-5 Character Input/Output Functions

Character input functions read one character at a time Character input functions read one character at a time from a text stream. Character output functions write from a text stream. Character output functions write one character at the time to a text stream.one character at the time to a text stream.

Terminal Character I/OTerminal and File Character I/OCharacter Input/Output Examples

Topics discussed in this section:Topics discussed in this section:

Computer Science: A Structured Programming Approach Using C 2

FIGURE 7-12 Character Input/Output Functions

Computer Science: A Structured Programming Approach Using C 3

PROGRAM 7-7 Create Text File

Computer Science: A Structured Programming Approach Using C 4

PROGRAM 7-7 Create Text File

Computer Science: A Structured Programming Approach Using C 5

PROGRAM 7-7 Create Text File

Computer Science: A Structured Programming Approach Using C 6

PROGRAM 7-8 Copy Text File

Computer Science: A Structured Programming Approach Using C 7

PROGRAM 7-8 Copy Text File

Computer Science: A Structured Programming Approach Using C 8

PROGRAM 7-9 Count Characters and Lines

Computer Science: A Structured Programming Approach Using C 9

PROGRAM 7-9 Count Characters and Lines

Computer Science: A Structured Programming Approach Using C 10

PROGRAM 7-10 Count Words

Computer Science: A Structured Programming Approach Using C 11

PROGRAM 7-10 Count Words

Computer Science: A Structured Programming Approach Using C 12

7-6 Software Engineering

In this section, we discuss some software engineering In this section, we discuss some software engineering issues related to files.issues related to files.

Testing FilesData Terminology

Topics discussed in this section:Topics discussed in this section:

Computer Science: A Structured Programming Approach Using C 13

PROGRAM 7-11 Handling Errors—the Right Way

Computer Science: A Structured Programming Approach Using C 14

PROGRAM 7-12 Handling Errors with Explanations

Computer Science: A Structured Programming Approach Using C 15

PROGRAM 7-12 Handling Errors with Explanations

Computer Science: A Structured Programming Approach Using C 16

Table 7-6 Ten Western States (2000 Census)