123456789101112
vector<int> a; vector<int> b; int c = 2; a.push_back(c); b.push_back(c); a[0] = 1; cout << a[0] << "\n"; cout << b[0] << "\n";
12
1 2
2 2
1 1
1234567891011
vector<int*> a; vector<int*> b; int c = 2; a.push_back(&c); b.push_back(&c); (*a[0]) = 1; cout << (*a[0]) <<"\n"; cout << (*b[0]) <<"\n";
vector<Foo>::iterator it = Bar.begin(); Foo aFoo = *it;
12345
vector<Foo> bar; vector<Foo>::iterator i = bar.begin(); Foo copy( *it ); Foo & reference( *it );