So I'm trying to create 4 arrays with data input from a .dat file, and for some reason it won't.
The file has four columns, and I want four arrays with the info from each column seperate.
For some reason, I'm having trouble doing that with the following code (minus header info):
//Creating my class members
ifstream infile;
Rocket ship;
//My arrays and their pointers
float alltime [7528];
float *t = alltime;
float allheight [7528];
float *h = allheight;
float allv [7528];
float *v = allv;
float alla [7528];
float *a = alla;
//Creating my most excellent arrays
while (infile.good())
{
infile >> *t >> *h >> *v >> *a;
t = t+4;
h = h+4;
v = v+4;
a = a+4;
}
if (infile.eof())
cout << "End of file reached\n"<<endl;
else {
cout << "Input terminated for unknown reason\n";
}
infile.close();
//Finishing up!
cin.get();
return 0;
}
So far I just get 4 giant arrays, but filled with 0s
What needs to be done in order to fix this?