Question: C++ something is wrong with the following code the file is not opening. Please help with it. int main() { vector firms; ifstream inFile; inFile.open(firm.dat);

C++

something is wrong with the following code the file is not opening. Please help with it.

int main() { vector firms; ifstream inFile; inFile.open("firm.dat"); if(!inFile) { cout << "Error opening file." << endl; return 1; } FirmData temp; while(inFile >> temp) { firms.push_back(temp); } for(int i = 0; i < firms.size(); i++) { cout << firms[i] << endl; }

inFile.close(); return 0; }

**Quickly please**

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 Programming Questions!