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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -