15.4k views
5 votes
Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable.

1 Answer

3 votes

Answer:

Following are the statement in the c++ language

ifstream inFile; // declared a variable inFile

ofstream outFile; //declared a variable outFile

Step-by-step explanation:

The ifstream and ofstream is the file stream object in the c++ Programming language .The ifstream file stream object is used for reading the contents from the file whereas the ofstream file stream object is used for writting the contents into the file.

  • We can create the variable for the ifstream and ofstream These variable is used for reading and writing into the File.
  • Following are the syntax to create the ifstream variable and ofstream variable

ifstream variablename;

ofstream variablename

User Mouserat
by
4.1k points