Hi! i'm pretty new at c++ and we've recently been learning about reading text files. So far we have just used getline and storing in a array/printing it out using a while loop and for loop iteration. I just wanted to know how you would want to store lines in separately like say you had a text file containing data on animals (age and weight) each on a separate line.
eg....
dog
5 (age)
10 (weight)
4 (age)
4
//blank line
cat
4 (age)
3 ..and so forth
if you had a fixed amount of animals for each type of animal, you could probably use an array, but how would you go about storing it in a vector and accessing, say, only the ages of dogs to get the average age?