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

Code Example 1

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

Code Example 2

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

Learn ReactJs, React Native from akashmittal.com