I would expect this to ouput the 5 doubles, but instead I get the output below.
vector<double> a(5);
a.push_back(1.2);
a.push_back(1.3);
a.push_back(1.4);
a.push_back(1.5);
a.push_back(1.6);
vector<double>::iterator i;
i = a.begin();
while( i != a.end() )
{
cout << *i << endl;
i++;
}
0
0
0
0
0
1.2
1.3
1.4
1.5
1.6
Any ideas why?
Thanks,
Dave