title: End array input with a newline?
body: <p>Not sure if the title is properly worded, but what I am trying to ask is how would you signify the end of input for an array using newline. Take the following code for example. Not matter how many numbers(more or less) you type during the input for score[6], it must take 6 before you can proceed. Is there a method to change it so that an array can store 6 or 100 variables, but you can decide how many variables actually contain values. The only way I can think of doing this is to somehow incorporate '\n', so that pressing enter once creates a newline and pressing enter again signifies that you don't want to set any more values. Or is something like this not possible?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
      int i,score[6],max;
      cout&lt;&lt;"Enter the scores:"&lt;&lt;endl;
      cin&gt;&gt;score[0];
      max = score[0];
      for(i = 1;i&lt;6;i++)
      {
          cin&gt;&gt;score[i];
          if(score[i]&gt;max)
              max = score[i];
      }
      return 0;
  }
  </code></pre>