cpp loop vector code example
Example 1: cpp print vector
for(int i = 0; i < vec.size(); i++)
std::cout << vec[i] << ' ';
Example 2: c++ iterate over vector
for(auto const& value: a) {
/* std::cout << value; ... */
}
Example 3: for loop vector
for (auto i = v.begin(); i != v.end(); i++)
{
std::cout << *i << endl;
}