title: C/C++ How to read from stdin after enter is hit twice in a row or after 2 newlines
body: <p>I'm trying to have the user input a block of text to the console that my program will read from stdin only after enter has been hit twice in a row or, said in a different way, when enter is hit on an already blank line.  But, I want to continue reading from stdin so basically, only read from stdin when enter is hit while on an already blank line.  Then flush and restart.</p>
  
  <p>Example of user input:</p>
  
  <pre><code>Hello(\n)
  World(\n)
  (\n)
  (Read Now)
  </code></pre>
  
  <p>I haven't been able to find an input function capable of specifying this behavior.</p>
  
  <p>Also, I've tried a few methods using single character retrieval functions but I haven't been able to get it work correctly.</p>
  
  <p>Anyone know of a way to do this elegantly?</p>
  
  <p>Answer implemented:</p>
  
  <pre><code>char word[100];
  int i = 0;
  while ((word[i++] = getchar())!='\n' || (word[i++]=getchar())!='\n');
  printf("%s",word);
  </code></pre>
  
  <p>Obviously buffer overflow needs to be dealt with before using this. Just an example.</p>