title: C++ Compare two multidimensional arrays
body: <p>I have two arrays:</p>
  
  <pre><code>unsigned char channeltab1[7][12]; //array which I receive from socket(Array is the same as below)
  unsigned char equal_channeltab1[7][12] //arrays which I wants to compare with channeltab1
  {
      {0x10, 0x0f, 0x02, 0x02, 0x01, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
      {0x10, 0x0f, 0x02, 0x02, 0x02, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
      {0x10, 0x0f, 0x02, 0x02, 0x03, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
      {0x10, 0x0f, 0x02, 0x02, 0x04, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
      {0x10, 0x0f, 0x02, 0x02, 0x05, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
      {0x10, 0x0f, 0x02, 0x02, 0x06, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
      {0x10, 0x0f, 0x02, 0x02, 0x07, 0x00, 0x00, 0x06, 0x10, 0x0e, 0xff, 0xef},
  };
  </code></pre>
  
  <p>I want compare this arrays, but function strcmp work only with one-dimensional arrays.
  I try use strncmp:</p>
  
  <pre><code>for(int x = 0; x&lt;7; x++)
  {
      for(int i =1; x&lt;12;i++)
      {
          if (strncmp (reinterpret_cast&lt;const char*&gt;(channeltab1[x][i]),reinterpret_cast&lt;const char*&gt;(equal_channeltab1[x][i]),2) == 0)
          {
              /*...*/
          }
          else
          {
              /*...*/
          }
      }
  
  }
  </code></pre>
  
  <p>But when application run this instruction says:
  Memory fault</p>
  
  <p>If i use:</p>
  
  <pre><code>for(int x = 0; x&lt;7; x++)
  {
      if (strncmp (reinterpret_cast&lt;const char*&gt;(channeltab1[x]),reinterpret_cast&lt;const char*&gt;(equal_channeltab1[x]),2) == 0)
      {
          /*..*/
      }
      else
      {
          /*..*/
      }   
  }
  </code></pre>
  
  <p>They are not the same for program.</p>
  
  <p>What should I do?</p>