for List Iterators i can access different elements
but i can only access one thing per object
eg
class student{
private :
string firstname;
string lastname;
// some other variables //etc...
public:
// some functions here ....
};
in the list i can access and print all the first name with the List Iterators
but how do I print
first name follow by last name in a List ?
This is what I think you’re talking about: if not, please give some more details.
I take it you’ve got a
std::listofstudent, likeAnd then you’re iterating over it, something like so:
If this is the case, just add a bit more for
it->getLastName():