Solved

Consider the Following Program Segment

Question 40

Multiple Choice
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");

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents