title: having problems using iterators with lists in c++
body: <p>I am writing an algorithm that checks for duplicate moves in checker in c++ but I am having problems with using the <code>iterator</code>.</p>
  
  <p>Here is my code:   </p>
  
  <pre><code>static std::list&lt;char[8][8]&gt; duplicates;   
  
      char checkForDuplicates[8][8];
      for(char i = 0;i &lt; 8;i++)
          for(char j = 0;j &lt; 8;j++)
              checkForDuplicates[i][j] = board[i][j];
      bool isDuplicate = false;
      for(std::list&lt;char[8][8]&gt;::iterator it = duplicates.begin(); it != duplicates.end(); it++)
      {
          for(char i = 0;i &lt; 8;i++)
          {
              for(char j = 0;j &lt; 8;j++)
              {
                  if(checkForDuplicates[i][j] != it-&gt;[i][j])
                      //do something
              }
          }
      }   
  </code></pre>
  
  <p>I especially need help with this line:</p>
  
  <pre><code>if(checkForDuplicates[i][j] != it-&gt;[i][j])
  </code></pre>
  
  <p>I am trying to compare an array element in the list to another array element but I have no idea how to access the array elements inside the list using the <code>list iterator</code>. Can anybody please assist me with examples and/or advice?</p>