title: how to input array of words c++
body: <p>I need to write a program that has as input an array of words, each word is 50 characters or less. (I can only use <code>&lt;iostream&gt;</code> and <code>&lt;string.h&gt;</code>)</p>
  
  <p>The sample input is : 
  watch stumble student point welcome</p>
  
  <p>my code:</p>
  
  <pre><code>char input[1000000];
  for (int i = 0, i &lt; 1000000, i++) {
      cin &gt;&gt; input[i];
  }
  </code></pre>
  
  <p>Now how can I identify each word(max 50 letters per word) and store it in a separate string ,so that:</p>
  
  <pre><code>str1 = 'watch'
  str2 = 'stumble'
  </code></pre>
  
  <p>and so on.</p>
  
  <p>Then I have to find all words that start with a prefix that the user inputs, for example
  if the prefix is "stu" the output is:
  stumble student</p>
  
  <p>I'd be really grateful if anyone can help in the next 1-2 hours!</p>