title: Declaration of static array generates the following warning: ISO C90 forbids variable length array 'v' [-Wvla]
body: <p>The below code works just fine to save and print a static 5-component array. However, I am still getting a warning that I don't really know how to fix: <code>[Warning] ISO C90 forbids variable length array 'v' [-Wvla]</code>. It comes from where the vector is declared:  <code>float v[n];</code> Any help on this one would be very much appreciated. Thank you! :-)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void print_vector(int N, float * V);
  void save_vector(int N, float * V);
  
  int main(void)
  {
      const int n = 5;
      float v[n];
  
      printf("Enter the %d components of the vector:\n", n);
      save_vector(n, v);
  
      puts("\nThe vector is:");
      print_vector(n, v);
  
      return 0;
  }
  
  void save_vector(int N, float * V)
  {
      int i;
      for(i = 0; i &lt; N; i++)
          scanf("%f", V+i);
  }
  
  void print_vector(int N, float * V)
  {
      int i;
      for(i = 0; i &lt; N; i++)
          printf(" %.2f ", V[i]);
  }
  </code></pre>