1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
// vector::cbegin/cend
#include <iostream>
#include <vector>
int main ()
{
std::vector<int> myvector = {10,20,30,40,50};
std::cout << "myvector contains:";
for (auto it = myvector.cbegin(); it != myvector.cend(); ++it)
std::cout << ' ' << *it;
std::cout << '\n';
return 0;
}
|