how to use vector iterator c++ code example
Example 1: c++ vector iterator
#include <iostream>
#include <vector>
using namespace std;
vector<int> myvector;
for (vector<int>::iterator it = myvector.begin();
it != myvector.end();
++it)
cout << ' ' << *it;
cout << '\n';
Example 2: declaring iterator in cpp
vector<int>::iterator ptr;