Question: This C++ code, can someone create notes for this and break down what each line means line by line? int readFloatMap(string fileName, double arr[][4], int
This C++ code, can someone create notes for this and break down what each line means line by line?
int readFloatMap(string fileName, double arr[][4], int rows) { ifstream f(fileName.c_str());
if(f.fail()) { return -1; }
double a, b, c, d;
int r = 0; while((r < rows) && (f >> a >> b >> c >> d)) { arr[r][0] = a; arr[r][1] = b; arr[r][2] = c; arr[r][3] = d; r++; }
return r; // success }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
