c++ vector for code example
Example 1: for vector c++
vector<int> vi;
...
for(int i : vi)
cout << "i = " << i << endl;
Example 2: for vector c++
for (auto it = begin (vector); it != end (vector); ++it) {
it->doSomething ();
}
Example 3: for vector c++
std::vector<int>::iterator it = vector.begin();