title: I've created a simple program but something is not right
body: <p>It works if I would remove the "=" sign on the for loop condition. But when I add an equal sign to it, it will crash after the first loop. So to sum up, the first loop will work but not the second one. Help please and thank you!</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  int main() {
  
    int arrayValue;
  
    cout &lt;&lt; "Enter an array value: ";
    cin &gt;&gt; arrayValue;
    cout &lt;&lt; endl;
  
    string names[arrayValue];
  
    for (int x = 0; x &lt;= arrayValue; x++) {
      cout &lt;&lt; "Enter a name for no." &lt;&lt; x &lt;&lt; ": ";
      cin &gt;&gt; names[x];
    }
  
    cout &lt;&lt; "No."
         &lt;&lt; "  ------  "
         &lt;&lt; "Value" &lt;&lt; endl;
  
    for (int j = 0; j &lt;= arrayValue; j++) {
      cout &lt;&lt; j &lt;&lt; "  ------  " &lt;&lt; names[j] &lt;&lt; endl;
    }
  }
  </code></pre>