title: Trouble understanding "list<int>::iterator i;"
body: <p>I've been studying how to make lists work in C++. Despite line 12 not working, I'm more interested in the line I mentioned in the title, as I do not understand what this does?</p>
  <p>Consequently, there is an error in the <code>for</code> loop, but I presume it's due to my lack of understanding of <code>list&lt;int&gt;::iterator i;</code>, if anyone could break down and explain what this line means to me that'd be amazing!</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;list&gt;
  
  using namespace std;
  
  int main(){
  
      list&lt;int&gt; integer_list;
  
      integer_list.push_back(0); //Adds a new element to the end of the list.
      integer_list.push_front(0); //Adds a new elements to the front of the list.
      integer_list (++integer_list.begin(),2); // Insert '2' before the position of first argument.
  
      integer_list.push_back(5);
      integer_list.push_back(6);
  
      list &lt;int&gt;::iterator i;
  
      for (i = integer_list; i != integer_list.end(); ++i)
      {
          cout &lt;&lt; *i &lt;&lt; &quot; &quot;;
      }
  
  
      return 0;
  
  }
  </code></pre>
  <p>This code was taken directly from <a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialC++STL.html#LIST" rel="nofollow noreferrer">here</a>. Only the list's name has been changed.</p>