title: Getting user input using cin.get() in C++ question
body: <p>I'm not sure what I'm missing here.  This is a snippet of code that I found on a site and I placed it in my program to see how it works and then I would modify it to my liking later.  I am including iostream and this code snippet is in my main function.</p>
  
  <pre><code>char buffer[80];
  cout &lt;&lt; "Enter the string: ";
  cin.get(buffer, 79);       // get up to 79 or newline
  cout &lt;&lt; "Here's the buffer:  " &lt;&lt; buffer &lt;&lt; endl;
  </code></pre>
  
  <p>What is happening is that the program never asks for the user input.  It just seems to print out the two cout statements and then ends.  The site where I got the snippet from shows the output of:</p>
  
  <pre><code>Enter the string: Hello World
  Here's the buffer: Hello World
  </code></pre>