title: How to access 1 element in 2D dynamic array in C++
body: <p>I'm new to C++, and I've been trying to figure out how to access just 1 element in a 2D array that I've dynamically allocated like so:</p>
  
  <pre><code>char** array;
  array = new char*[3];
  for(int i = 0; i &lt; 3; i++) {
      array[i] = new char [3];
  }
  </code></pre>
  
  <p>I've been trying to access it like this:</p>
  
  <pre><code>cout&lt;&lt; array[0][0];
  </code></pre>
  
  <p>Whenever I try to do this, nothing prints out and the program segfaults.
  How should I fix it so that it prints? 
  Thank you for your time!</p>