Check out example codes for "c++ iterate over vector". It will help you in understanding the concepts better.

Code Example 1

for(auto const& value: a) {
     /* std::cout << value; ... */
}

Code Example 2

std::vector<int> vec_of_ints(100);
for (int i = 0; i < vec_of_ints.size(); i++){
 	std::cout << vec_of_ints.at(i) << " "; 
}
std::cout << std::endl;

Code Example 3

for(std::vector<T>::size_type i = 0; i != v.size(); i++) {
    v[i].doSomething();
}

Code Example 4

for (auto & element : vector) {
    element.doSomething ();
}

Learn ReactJs, React Native from akashmittal.com