title: sizeof() of an array with random length
body: <p>Can you explain how the <code>sizeof()</code> works with a random length array? I thought <code>sizeof()</code> on an array is calculated during the compilation, however, the size of an array with random length seems to be calculated correctly.</p>
  
  <p>Example: </p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  
  int main(){
      srand ( (unsigned)time ( NULL ) );
      int r = rand()%10;
      int arr[r]; //array with random length
      printf("r = %d size = %d\n",r, sizeof(arr)); //print the random number, array size
      return 0;
  }
  </code></pre>
  
  <p>The output from multiple runs:</p>
  
  <pre><code>r = 8 size = 32
  r = 6 size = 24
  r = 1 size = 4
  </code></pre>
  
  <p>Compiler: gcc 4.4.3</p>