mardi 24 septembre 2019

How to iterate list of object pointed by pointer

how to get data from list of objects which is pointed by a pointer.

std::list<object> *myList;

std::list<object>::iterator itr;

for(itr = myList.begin(); itr != myList.end(); itr++) {
  std::cout << itr->data;
}

Aucun commentaire:

Enregistrer un commentaire