title: Array - runtime error: index out of bounds for type 'int [*]'
body: <p>The user can enter two integer number n, k: k &lt; n.</p>
  <p>Now one must enter n arbitrary integer numbers which i want to store in an array.</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(){
      int n, k;
      int scores[n];  
      cin &gt;&gt; n &gt;&gt; k;
      
      for (int i = 0; i &lt; n; i ++){
          cin &gt;&gt; scores[i];
      }   
  }
  </code></pre>
  <p>For n = 5 , k = 3 I get the following error message after entering the third random number</p>
  <pre><code>untitled.cpp:13:18: runtime error: index 3 out of bounds for type 'int [*]'
  </code></pre>
  <p>How can scores[3] be out of bounds if the total array &quot;scores&quot; consists of 5 elements?</p>