title: The correct way to Malloc() space for a pointer to an array of int
body: <p>Say I have a pointer to an array of <code>int</code>'s, like so: <code>int (*x)[3]</code>.
  What is the correct way to allocate space for such a variable? For example, say I wanted space for 10 items (so that I can store a total of <code>10 * 3 = 30</code> values in x):</p>
  
  <pre><code>/* Is this the correct way? */
  x = malloc(sizeof(x) * 10);
  
  /* Will it allow me to do this? */
  x[0][0] = 10;
  x[0][1] = 20;
  x[0][2] = 30;
  
  x[1][0] = 40;
  x[1][1] = 50;
  x[1][2] = 60;
  
  /* ... etc ... */
  </code></pre>
  
  <p>Or is there some other way to correctly malloc the memory for <code>x</code> (i.e. <code>x = malloc(sizeof(int) * 10)</code> or <code>x = malloc(sizeof(int *) * 10)</code>? </p>
  
  <p>Thanks.</p>