title: Array size with const variable in C
body: <p>I've found an interesting fact, and I didn't understand how is it works.
  <br/>The following piece of code just works perfectly.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
   int main(){
    const int size = 10;
    int sampleArray[size];
    typedef char String [size];
    return 0;
  }
  </code></pre>
  
  <p>Then, I tried to use only and only the constant variable with a global scope, and it's still fine.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  const int size = 10;
   int main(){
    int sampleArray[size];
    typedef char String [size];
    return 0;
  }
  </code></pre>
  
  <p><br/>But, if I change the arrays's scope to global as well, I got the following: </p>
  
  <blockquote>
    <p>error: variably modified ‘sampleArray’ at file scope</p>
  </blockquote>
  
  <pre><code>#include &lt;stdio.h&gt;
  const int size = 10;
  int sampleArray[size];
  typedef char String [size];
   int main(){
    return 0;
  }
  </code></pre>
  
  <p>And I didn't get it! If I'd replace the const variable for ex. to <code>#define</code> it'd be okay as well. <br />
  I know that the #define variable is preprocessed, and as far as I know the const variable is only read-only. But what does make the global scope after all? 
  <br /></p>
  
  <p>I don't understand what is the problem with the third piece of code, if the second one is just okay.</p>