title: I don't understand how to create and use dynamic arrays in C++
body: <p>Okay so I have;</p>
  
  <pre><code>int grid_x = 5
  int * grid;
  grid = new int[grid_x];
  *grid = 34;
  cout &lt;&lt; grid[0];
  </code></pre>
  
  <p>Should line 3 create an array with 5 elements? Or fill the first element with the number 5?</p>
  
  <p>Line 4 fills the first element, how do I fill the rest?</p>
  
  <p>Without line 4, line 5 reads "-842150451".</p>
  
  <p>I don't understand what is going on, I'm trying to create a 2 dimensional array using x and y values specified by the user, and then fill each element one by one with numeric values also specified by the user. My above code was an attempt to try it out with a 1 dimensional array first.</p>