Question: I am unable to get my code to work, at this point I am basically justt trying to get the file map-input-100-100.dat to open. Does

I am unable to get my code to work, at this point I am basically justt trying to get the file "map-input-100-100.dat" to open. Does anyone have a solution?

#include

#include

#include

#include

#include

#include

using namespace std;

int main() {

int num_cols = 0;

int num_rows = 0;

vector sizeCheck;

vector > dataInput;

vector> Rvals;

vector> Gvals;

vector> Bvals;

string ele_File = "";

cin >> num_cols >> num_rows;

ifstream inputFile;

inputFile.open("map-input-100-100.dat");

if (!inputFile) {

cout << "Error: Unable to open file";

return 0;

}

for (int i = 0; i

{

for (int j = 0; j < num_cols; j++)

{

inputFile >> dataInput.at(i).at(j);

}

}

inputFile.close();

return 0;

}

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!