title: 2D array as instance variable of class
body: <p>So if I have a class with a 2D array that I want to initialize with two parameters passed into the constructor, how would I do that, I keep running into errors because it won't let me update the two-d array at all in the constructor.</p>
  
  <p>-- <em>Update from the comments:</em></p>
  
  <p>In my header file I tried both </p>
  
  <pre><code>int array[][] 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>int **array 
  </code></pre>
  
  <p>and then in the .cpp file in the constructor I'm trying to do </p>
  
  <pre><code>array = new int[arg1][arg2]
  </code></pre>
  
  <p>Neither declaration of the array in the header file worked.</p>