cout <<"\n\nThe value of time start array is " << time_Startarray[y];
}
}
}
return 0;
}
text file would look like this...
00:00 4:00 1.5
4:01 8:00 2.5
8:00 19:00 0.9
19:00 22:30 1.8
22:31 24:00 0.3
please excuses the excess of the library files at the start, this is a scaled down version of the program i'm using, i just didn't bother trying to figure out which libraries aren't need in this..
ideally I want to get this working, to place into a function.
the 1st part while(getline.....) is just been use to find the number of lines in the text file and been used further on to identified the number of calculation necessary (not shown above), this will then be used to set the size of the arrays. then i want to loop through the file again, taking in the values and storing this in the arrays.
this is where i am encountering the problem. i can't seem to set the pointer back to the start of the file. this is where all the inputFile.tellg() are in place for, you should be able to see that after the 1st while loop the value gets set to -1, and can't seem to set this back to 0..
inputFile.seekg (0, ios::beg);
has been identified to reset the pointer, but it doesn't seem to work.
has anyone encounter this previously?? or any suggestions??
any help greatly appreciate.