Chapter 6


1.

What are two modes you can open a file in?

binary and text

2.

What is the difference between the get method and the getline method?

 get retrieves on character at a time whereas getline retrieves an entire line at a time.

3.

What header file must you include for file input and output?

 fstream.h

4.

What is a flat file?

a file with no formatting/relational structure that uses only ascii codes. much like a text file created with microsoft notepad.

5.

What method can you use to change a file’s mode?

 setmode

6.

Why would you not want to use the read method to read in plain text?

because the read method gives you binary rather than text

7.

What is ASCII?

the american standard code for information interchange-a 255-character set of numeric values representing the various keys on your keyboard.

8.

How does the << operator work with file output?

much like it does with cout , it simply outputs the values on the right to the destination on the left.

9.

What is a binary file?

a file that stores the data in a byte-by-byte fashion

10.

What is the eof property of a fstream file?

it returns true if you have reached the end of the file in question, false if not.

Answers

1.

Binary and Text

2.

Get retrieves on character at a time whereas getline retrieves an entire line at a time.

3.

fstream.h

4.

A file with no formatting/relational structure that uses only ASCII codes. Much like a text file created with Microsoft Notepad.

5.

setmode

6.

Because the read method gives you binary rather than text

7.

The American Standard Code for Information Interchange—a 255-character set of numeric values representing the various keys on your keyboard.

8.

Much like it does with cout, it simply outputs the values on the right to the destination on the left.

9.

A file that stores the data in a byte-by-byte fashion

10.

It returns true if you have reached the end of the file in question, false if not.




C++ Programming Fundamentals
C++ Programming Fundamentals (Cyberrookies)
ISBN: 1584502371
EAN: 2147483647
Year: 2005
Pages: 197
Authors: Chuck Easttom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net