You did this:
list<MAINSTRUCT*>::iterator it=m_lstMainList.begin();//loop through and find the element of the list I want (would be done here)it=(*it)->m_lstRectList.begin();
That looks almost right. Here's what I'd put:
list<MAINSTRUCT*>::iterator it = m_lstMainList.begin();list<RECT*> it2 = (*it)->m_lstRectList.begin();
The difference is you're using the same iterator (
it) to iterate through the outer and inner lists. Which won't work for a few reasons, one of which is that they're different types.