
Consider the following program segment.
Ifstream inFile; //Line 1
Int x,y; //Line 2
... //Line 3
InFile >> x >> y; //Line 4
Which of the following statements at Line 3 can be used to open the file progdata.dat and input data from this file into x and y at Line 4?
A) inFile.open("progdata.dat") ;
B) inFile(open,"progdata.dat") ;
C) open.inFile("progdata.dat") ;
D) open(inFile,"progdata.dat") ;
Correct Answer:
Verified
Q26: C++ has a special name for the
Q29: C++ comes with a wealth of functions,
Q36: Suppose that ch1 and ch2 are char
Q38: What is the output of the following
Q39: Suppose that x = 1565.683,y = 85.78,and
Q39: The function _ returns the next character
Q41: cin is called a(n)_ object.
Q43: The manipulator _ is used to output
Q44: To use a parameterized stream manipulator in
Q45: To use the manipulator setprecision,the program must
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents