Reading files into ARRAYS

OK heres my problem Im trying to Read a file into an array. My data file looks like this
ID NAME GRADE
1 John 89.97
2 Cathy 99.23
3 Tom 100
4 Tim 93.27
5 Mary 98.66
6 David 100
7 Rose 32.66
8 Susan 87.56
9 Jack 50.33
10 Peter 92.87


Im supposed to save it to 3 arrays and this is where im getting confused.I think i declared them right but confused on what to do after. i think my declarations are right.I need a for loop to actually right to get the values from the text file right? I have bits and pieces of the program but unsure how to put it together.SO if anyone could point me in the right direction id appreciate it

string filename;
ifstream infile;
ofstream tofile;

int ID[10];
double Grade[10];
string Name[10];

inFile.open("assignment4.dat");

there is no problem in this, you have to paste some more code. are you including the correct headers?
Topic archived. No new replies allowed.