title: int ** vs int [ROWS][COLS]
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2895433/casting-char-to-char-causes-segfault">casting char[][] to char** causes segfault?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a 2D array declared like this:</p>
  
  <pre><code>int arr[2][2]={ {1,2},{3,4}};
  </code></pre>
  
  <p>Now if I do:</p>
  
  <pre><code>int ** ptr=(int**) arr;
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>cout&lt;&lt;**ptr;
  </code></pre>
  
  <p>I am getting a segmentation fault (using g++-4.0).</p>
  
  <p>Why so? Shouldn't it be printing the value 1 (equal to <code>arr[0][0]</code>)?</p>