title: Const auto variable of "2d array" allows for modifiable value in const 2d array?
body: <p>So I'm using visual studio for this. I was fiddling around with creating arrays and realized that a const auto variable as an array allows for change in array value for some reason? Then I tried it with a const pointer array as well and it of course causes an error.</p>
  
  <p>I initialized both the arrays to be set to all 0's. Yet if I change any value at a index in the const auto array it doesn't throw an error. I haven't tested this on any other frame works.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>int main()
  {
      const int x = 5;
      const int y = 4;
  
      const auto arr = new int[x][y] (); //Sets arr to all 0's
  
      int a = 3; //variable to be inserted
  
      arr[0][0] = a; //Allows for change at index
      arr[3][2] = a; //Allows for change at index
  
      for (int i = 0; i &lt; x; ++i)
      {
        for (int j = 0; j &lt; y; ++j)
        {
           cout &lt;&lt; arr[i][j] &lt;&lt; " "; //Prints arr
        }         
        cout &lt;&lt; endl;
      }
  
      //Now on to pointer array
      const int *pt = new int[x * y] (); //Sets pt to all 0's
  
      for (int i = 0; i &lt; x; ++i)
      {
        for (int j = 0; j &lt; y; ++j)
        {
          pt[i * y + j] = a; //Obliviously Throws modifiable error 
          cout &lt;&lt; pt[i * y + j] &lt;&lt; " "; 
        }
        cout &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>First array gets printed as such (const auto array):</p>
  
  <p>3  0  0  0</p>
  
  <p>0  0  0  0</p>
  
  <p>0  0  0  0</p>
  
  <p>0  0  3  0</p>
  
  <p>0  0  0  0</p>
  
  <p>Second array throws error as stated above.</p>