Check out example codes for "cpp loop through object". It will help you in understanding the concepts better.

Code Example 1

std::list<Student>::iterator it;
for (it = data.begin(); it != data.end(); ++it){
    std::cout << it->name;
}

Learn ReactJs, React Native from akashmittal.com