cpp loop through object

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

Also in C++: