??????????????????

how can i make a program that reads from an input file as following :

the input file contains TWO lines: the first line contains length of the ladder , the number of steps in the ladder (maximum 99) and the number of bulbs (maximum 6) to be replaced. The second line contains the height

and this is a part of the input file:

3.54 9 2
216 383
1.98 14 6
150 376 599 303 553 358

as you can see ..the number of height values varies in each second line

and i have to read each height(of the bulb) and check some conditions..then move to the next height at the same line and so on
so.. how can i read each height alone and work on it and then go to the next height???
1
2
3
4
5
6
7
8
9
10
11
12
inputFile >> length;
inputFile >> numSteps;
inputFile >> numBulbs;

while (int i=0; i<numBulbs; ++i)
{
  inputFile >> tempValueForHeight;
  vectorOfHeight.push_back(tempValueForHeight);
}

// Now have a vector containing all the second line value.
// Play with number, when finished repeat whole thing 
thanks a lot .....but what i have to include for
vectorOfHeight.push_back(tempValueForHeight);
??? i mean which library?
vector
Topic archived. No new replies allowed.