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