lundi 14 février 2022

How to handle and iterate through this list?

I have this type of list:

std::list<MyClass*>*

I want to iterate through this list and I also want to call the methods of MyClass, I want to do something like this:

std::list<MyClass*>* elements;

for (?)
{
    std:: cout << elements[i]->Membermethod(); << std::endl;
}

How can I do it?

Aucun commentaire:

Enregistrer un commentaire