Wow I've been all over the place with questions today and I apologize if they seem to overlap, but for every question comes another question...Since one thing wont work......but I should use something else......etc.
Anyways, I have a text file:
6
3.0 2.5 -1.5 0.0 1.7 4.0
6 10
6 is the Number of "floats" in the second line (the 3.0,2.5 etc...) 3.0,2.5,-1.5 are all a series of floats. 6 and 10 are just 2 integers.
I have a Vector
std::vector<double> numbers;
All i need to do, is get the Second line put into numbers. So right now I have
ifstream myfile (filename.c_str());
I can simply just do a myfile>> to get the first value (6) but how would I go about putting the second line in my vector? Remember I ONLY know how big line 2 is, by reading in the first line (the 6 in this case).
Also the last 2 numbers aren't supposed to be in this vector, but two seperate values. Which i can just do myfile >> a >> b.
Sorry again for sooo many questions. but I've literally been looking everywhere and asking probably the wrong questions.