title: How to only print the first word of a string in c++
body: <p>How do I set this up to only read the first word the user enters IF they enter to much info? </p>
  
  <p>I do not want to use an if-else statement demanding they enter new info because their info was to much. </p>
  
  <p>I just want it to basically ignore everything after the first word and only print the first word entered. Is this even possible?    </p>
  
  <pre><code>const int SIZEB = 10;
  char word[SIZEB];
  cout &lt;&lt; " Provide a word, up to 10 characters, no spaces. &gt; " &lt;&lt; endl;
  cin.getline(word, SIZEB);
  cout &lt;&lt; " The word is: " &lt;&lt; word &lt;&lt; endl;
  cout &lt;&lt; endl;
  </code></pre>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>It HAS to be a cstring. This is something I am working on for school. I am asking a series of questions and storing the answers as cstring in the first round. Then there is a second round where I store them as string. </p>