Question: ACTIVITY 5 . 1 . 1 : File input. 5 4 1 1 3 2 3 2 6 8 9 9 2 qx 3 zqy

ACTIVITY
5.1.1: File input.
5411323268992 qx3zqy7
Jump to level 1
String nameOfFile is a file's name read from input, and is opened as an input file. If inFS.is_open () returns false, then:
Output nameOfFile followed by ": file open failed" and a newline.
Terminate the program with the return value 1, so that the program does not proceed to read the file.
Click here for examples
\table[[data1.txt,data2.txt,data3.txt]]
#include iostream>
#include fstream>
using namespace std;
int main(){
ifstream inFS;
string nameoffile;
int cabinetQuantity;
cin nameoffile;
inFS.open (nameOfFile);
/* Your code goes here */
inFS > cabinetQuantity;
cout cabinetQuantity endl;
 ACTIVITY 5.1.1: File input. 5411323268992 qx3zqy7 Jump to level 1 String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!