Right, I know this is for a trivial program but I'm trying to improve my problem solving skills by making a program that will calculate the average of any amount of numbers you enter, and I plan to do this using Vectors.
The question is, I know how to put things into vectors, but I'm not sure about multiple items. Here's what I was thinking:
Code:
cin >> Avg1 >> Avg2 >> Avg3;
double x;
while (cin >> x)
{
Average.pushback(x);
}
I know why cin >> x works, but will it put all 3 of the values into the vector, or just the latest one I've added (Avg3)?
If what I've said is hard to understand, can cin hold multiple values ready to used?