This is a red quiz. The people to your left and right should have a blue quiz. |
Print your name here____________________________________________________ ID#___________________
Please write your answers on the this sheet, and PRINT your name and ID number above. This quiz covers file I/O operations from Secs. 8.3 through 8.5, as well as the basics of arrays, from Secs. 9.1 and 9.2
Question 1.
Assuming the declaration
ifstream inFile;
write out the two instructions to 1: Open a file called file1.txt and
2: Use getline() to read the first line of the file into the string variable inString.
Question 2.
What is the data type designator for an output file stream? (one-word answer)
Question 7.
What do the following statements do? For each part of the question below, a-f,
start fresh with the array int ar[] = {4, 2, 7, 5, 9}.
for(int i = 0; i < aa[2]; i += 2) cout << aa[i] << ' ';