title: Using cin.get() to grab a line of text, then using it in a loop to display that line?
body: <p>Ok, so I came across this code snippet in my textbook that's supposed to echo every other character a user types in. Now, I understand the every other character part, but I'm having difficulty with the use of cin.get(). I understand why the first cin.get() is there, but why is it also inside the loop? I'm guessing I'm not fully grasping the nature of input streams...</p>
  
  <p>EDIT: It just clicked... I'm an idiot. Thanks for clearing that up.</p>
  
  <pre><code>char next;
  int count = 0;
  cout &lt;&lt; "Enter a line of input:\n";
  cin.get(next);
  
  while (next != '\n')
  {     
      if ((count%2) == 0)
      cout &lt;&lt; next;
      count++;
      cin.get(next);
  }
  </code></pre>
  
  <p>Thanks in advance!</p>