   stl::list Solved
  started using this in c++, and i've hit a wall.  i'm ok adding items to a list, but how do i iterate through the list and access them?  so far i've gotstd::list<theButton> l;for(l = this->mButtonList.begin() ; l < this->mButtonList.end(); l++){///???}edit: cheers guys![Edited by - Winegums on September 12, 2007 3:04:49 PM]
for (std::list<theButton>::iterator it = l.begin(); it != l.end(); ++it){    it->theButtonMember;    //or    (*it).theButtonMember;}See: Iterators.   ;  std::for_each is good too. [smile]   ;  Here are some good books if you prefer.http://www.amazon.co.uk/Effective-STL-Specific-Professional-Computing/dp/0201749629/ref=pd_bbs_sr_1/202-7631349-1347814?ie=UTF8&s=books&qid=1189627031&sr=8-1This book serves as a good general guide to STL.http://www.amazon.co.uk/C-Standard-Library-Tutorial-Reference/dp/0201379260/ref=cm_lmf_tit_4_rsrrsi0/202-7631349-1347814This book gives very thorough coverage of all aspects of STL, including internals.   