//The error I get is "cannot convert 'int' to 'T*' for argument '1' to 'int readFile(T*,T*,T*,std::istream&)'"
//The error is at the highlighted line below
//readFile.h contains my constant, libraries, and all other necessary things
#include "readFile.h"
int main(){
int x[MAX_SIZE],y[MAX_SIZE],m[MAX_SIZE];
ifstream fin; // declare ifstream object
fin.open("p4p5Data.txt"); // attach file p4p5Data.txt
if (fin.fail()){ // check it out
cout << "\n\aBummer! File p4p5Data.txt"; // report bad news
cout << " could not be opened. Goodbye.";
exit(-1); // outta here
} int numDataPoints = readFile(x, y, m, fin); // go get data from disk
cout << "\nnumDataPoints = "; // TEMP check data points
cout << numDataPoints;
ofstream fout; // declare ofstream object
fout.open("p4Output.txt"); // attach it to disk file
int numDataPoints = -1; // temp value
is >> numDataPoints;
if (numDataPoints > MAX_SIZE) { // ensure not too big
cout << "\n\n\aTruncating data ";
cout << "due to size constraints.\n\n";
numDataPoints = MAX_SIZE; // truncate if needed
}
for (int i = 0; i < numDataPoints; ++i) { // read data groups
is >> x[i];
is >> y[i];
is >> m[i];
}
ifstream fin; // declare ifstream object
fin.open("p4p5Data.txt"); // attach file p4p5Data.txt
if (fin.fail()){ // check it out
cout << "\n\aBummer! File p4p5Data.txt"; // report bad news
cout << " could not be opened. Goodbye.";
exit(-1); // outta here
}
numDataPoints = readFile(x, y, m, fin); // go get data from disk
cout << "\nnumDataPoints = "; // TEMP check data points
cout << numDataPoints;
ofstream fout; // declare ofstream object
fout.open("p4Output.txt"); // attach it to disk file