title: C++ STL Vector Iterator accessing members of an Object
body: <p>I think I've declared a Vector with an object correctly.  But, I don't know how to access it's members when looping with Iterator.</p>
  
  <p>In my code, the line --->>  cout &lt;&lt; " " &lt;&lt; *Iter;</p>
  
  <p>How do I print the contents of the members?  Like *Iter.m_PackLine ???</p>
  
  <p>Not sure if I used the correct terminology, but appreciate the help!  Thanks</p>
  
  <pre><code>class CFileInfo
  {
    public:
        std::string m_PackLine;
        std::string m_FileDateTime;
        int m_NumDownloads;
  };
  
  void main()
  {
    CFileInfo packInfo;
  
    vector&lt;CFileInfo, CFileInfo&amp;&gt; unsortedFiles;
    vector&lt;CFileInfo, CFileInfo&amp;&gt;::iterator Iter;
  
    packInfo.m_PackLine = "Sample Line 1";
    packInfo.m_FileDateTime = "06/22/2008 04:34";
    packInfo.m_NumDownloads = 0;
    unsortedFiles.push_back(packInfo);
  
    packInfo.m_PackLine = "Sample Line 2";
    packInfo.m_FileDateTime = "12/05/2007 14:54";
    packInfo.m_NumDownloads = 1;
    unsortedFiles.push_back(packInfo);
  
   for (Iter = unsortedFiles.begin(); Iter != unsortedFiles.end(); Iter++ )
   {
      cout &lt;&lt; " " &lt;&lt; *Iter; // !!! THIS IS WHERE I GET STUMPED
      // How do I output values of the object members? 
   }
  }  // end main
  </code></pre>