how to access the list inside a list in c++?
<p>Okay, so I first started learning C# and now I am learning C++ so I'm kind of new to it.<br>
In C#, when I wanted to access the list inside a list, I would simply use nested for-each loops.   </p>

<p>Now since in C++ I don't know how to use a for-each loop, I tried to access the nested list with for loops.</p>

<p>Here is my code:   </p>

<pre><code>int main

{      
    list&lt;list&lt;char *&gt; &gt; moves; 

    list&lt;char *&gt; pointers;

    list&lt;list&lt;char&gt; &gt; undoValues;
    list&lt;char&gt; undoValue;

    for(list&lt;list&lt;char *&gt; &gt;::iterator outer=moves.begin();outer!=moves.end();outer++)
    {
        for(list&lt;char *&gt;::iterator inner=outer.begin();inner!=outer.end();inner++)
        {

        }
    }
}
</code></pre>

<p>I get 2 errors:</p>

<pre><code>error 'struct std::_List_iterator&lt;std::list&lt;char*&gt;,std::allocator&lt;char *&gt; &gt; &gt;' has no member named begin

error 'struct std::_List_iterator&lt;std::list&lt;char*&gt;,std::allocator&lt;char *&gt; &gt; &gt;' has no member named end
</code></pre>

<p>How can I access the nested list?</p>
