splitting a string line read from a txt file

Hi,

I need some help with my reading input code. First I open a file read from the user. The idea is to read until the end of the line, split that line after every space and finally save that string as an int into an array. Move onto the next line until the last line has ***

code:
void readInput() {
int num = 0, i=0, j=0;
string fName, line;
cin >> fName;
ifstream inFile;
inFile.open(fName.c_str());

std::getline(inFile, line, '\n');
while(line != "***") {
proc[i][0] = 0; //initial start time
proc[i][1] = 0; //initial end time
j=5;
while(!eofbit) {
proc[i][j]=atoi(line.c_str());
j++;
std::getline(inFile, line, ' ');
}
proc[i][5] = calcOP(proc[i][5]); //change nice value to priority
proc[i][2] = calcTS(proc[i][5]); //calculate time slice

i++;
numProc++;
}
}

FileInput.txt:
11 200 2 300 321 450
1 100 1 4000
-14 200 2 250 350 200
10 200 1 700
***
Topic archived. No new replies allowed.