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

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -