Answer the following questions true (T) or false (F)
1. When you write
ifstream inStream;
inStream.open(”infile.dat”);
the file, infile.dat must be located in the directory where the program is being run.
2. When you use the open member function to tie a file name to a file stream, the file name is called the external file name, and the program refers to the file by the stream name.
1. False
Explanation: If infile.dat is not in the directory where the program is being run, you can supply a path in addition to the file name. The details are system dependent. Though this question is predicated on input, the same thing is true of output file streams.
2. True
Explanation: In a program, each file has two names, whether the file is for input or output. The external file name is the real name of the file. It is used in the program only as an argument for the open member function. The program always refers to the file using the stream name.
You might also like to view...
List two ways you can specify the MySQL password for a user to access MySQL.
What will be an ideal response?
Describe a pattern of access to a splay tree that would provide excellent performance. Now describe an access pattern that would provide poor performance.
What will be an ideal response?
The two main reasons for creating templates for commonly used forms in an organization are ________
A) validation and relationship B) validation and standardization C) lookup and validation D) standardization and protection
You can use the asterisks at the beginning of a search string entry to search for any number of unspecified letters, numbers, or other characters
Indicate whether the statement is true or false