for (int i = 0; i < Vector.size(); i++)
{
type Element = Vector[i];
}
for (const auto& i : vector)
{
// do something
}
vector<int> vi;
...
for(int i : vi)
cout << "i = " << i << endl;
for(std::vector<T>::size_type i = 0; i != v.size(); i++) {
v[i].doSomething();
}
// Using a for loop with iterator
for(std::vector<int>::iterator it = std::begin(v); it != std::end(v); ++it) {
std::cout << *it << "
";
}