I'm very new to C++ and struggling to figure out how I should iterate through a list of objects and access their members.
I've been trying this where data is a std::list and Student a class.
std::list<Student>::iterator<Student> it;
for (it = data.begin(); it != data.end(); ++it) {
std::cout<<(*it)->name;
}
and getting the following error:
error: base operand of ‘->’ has non-pointer type ‘Student’