How can I read multiple datas from outside text file that have the same data type by declaring only one variable?
For example:
numbers below are scores and they are double, the negative number is used a "break" jump to the next record
10 76 50 -1
63 13 24 70 -1
-44
94 70 80 -3
Here is my code:
The problem is that each record has different number of score and I can't find a way to get each score.Code:double score=double(); while (score>0) { in score; } cout << score << endl;
Note that I used "in" instead of "cin" cuz I read outside data file and then view it on the screen....
Any advice? ....



LinkBack URL
About LinkBacks



CornedBee