c++ - Iterating through a list of a custom class -


i'm trying iterate through list contains objects of type 'window' (a custom class wrote). loop supposed use gettitle() method of window class on each element , print out title in console.

for reason when try access method through iterator tells me method not exist..

this code:

void center::printwindowlist() {     (std::list<window>::iterator = windowlist.begin(); != windowlist.end(); ++it)         std::cout << ' ' << *it.gettitle(); } 

hope can help

it's issue of operator precedence. try doing it->gettitle() or (*it).gettitle().


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -