I'm trying to read data in from a txt file using fstream. It works fine (complies and runs with the expected restul) if the code is in one cpp file. Unfortunately the project requirements say I have to use classes. So I make a stats class and the constructor for the Stats object is suppose to read in the data. So I'm thinking that I'm missing something in the translation from 1 file into breaking it up into three files, but I can't for the life of me figure out what it is. :(
double data[]; that's not right. I don't know what the standard says about this nor how compilers deal with it (I have a feeling it might be equivalent to double*). Anyway, it should be either double data[25]; or double* data; and then in Stats constructor, data = newdouble[numElements]; (and then delete[] data; in the destructor).