title: Read-only variable is not assignable
body: <p>Yes this is for homework, my code is asking me to enter an array that is terminated upon typing in the number 0 or when it reaches the maximum number of integers <code>ARRAY_SIZE</code> so when I type in my code the line <code>array[num_elements]=i;</code> returns an error that states <code>Read-only variable is not assignable</code>.</p>
  
  <pre><code>void read_list(const int array[], int &amp; num_elements) {
      int i(1);
  
      cout&lt;&lt;"Enter list of "&lt;&lt; ARRAY_SIZE&lt;&lt;" integers (ending with 0)";
  
      while (i != 0 &amp;&amp; num_elements &lt; ARRAY_SIZE) {
          cin &gt;&gt; i;
          array[num_elements] = i;
  num_elements++;
      }
  
  }
  </code></pre>