title: 'Constant Expression Required' Error while keeping formal argument as a constant
body: <p>This is a C++ programming code to display the values of array1 and array2 but I am getting a compile time error as 'Constant Expression Required'. Please Help</p>
  
  <pre><code>void display(const int const1 = 5)
  {
      const int const2 = 5;
      int array1[const1];
      int array2[const2];
  
      for(int i = 1 ; i &lt; 5 ; i++)
      {
          array1[i] = i;
          array2[i] = i * 10;
  
          std::cout &lt;&lt; array1[i] &lt;&lt; std::endl;
      }
  }
  
  void main()
  {
      display(5);
  }
  </code></pre>