1. | What are two modes you can open a file in? | |
2. | What is the difference between the get method and the getline method? | |
3. | What header file must you include for file input and output? | |
4. | What is a flat file? | |
5. | What method can you use to change a file’s mode? | |
6. | Why would you not want to use the read method to read in plain text? | |
7. | What is ASCII? | |
8. | How does the << operator work with file output? | |
9. | What is a binary file? | |
10. | What is the eof property of a fstream file? | |
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. |