18.5k views
3 votes
What is the purpose of the following statements?

ifstream inFile;
inFile.open("datafile.dat");

User Coren
by
7.6k points

1 Answer

7 votes

Final answer:

The purpose of the statements ifstream inFile; and inFile.open("datafile.dat"); is to declare an input file stream object named inFile and then open a file named datafile.dat for reading. statements ifstream inFile; inFile.open("datafile.dat"); is to declare an input file stream object named inFile and then open a file named datafile.dat for reading.

Step-by-step explanation:

The purpose of the statements ifstream inFile; and inFile.open("datafile.dat"); is to declare an input file stream object named inFile and then open a file named datafile.dat for reading. statements ifstream inFile; inFile.open("datafile.dat"); is to declare an input file stream object named inFile and then open a file named datafile.dat for reading.

purpose of the statements ifstream inFile; and inFile.open("datafile.dat"); is to declare an input file stream object named inFile and then open a file named datafile.dat for reading. statements ifstream inFile; inFile.open("datafile.dat"); is to declare an input file stream object named inFile and then open a file named datafile.dat for reading.

User Matroska
by
8.3k points