title: getting console input for Cstrings
body: <h1>note: this is in C++ but using C-style strings</h1>
  <p>hello SO,</p>
  <p>I'm working on an assignment and I need to get input from the console and save it to a cstring.  Everything compiles fine, but when the program runs, it just skips over getting input from the user.  So it will output: &quot;Enter string to be inserted: &quot; then skip the cin.getline function, then execute the next command.</p>
  <p>Here's my header files, the declaration of the cstring, and the line of code I'm having trouble with.</p>
  <pre><code>#include &quot;stdafx.h&quot;
  #include &lt;iostream&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  int main()
  {
    char tempCString[500] = {};
  
  //...code snipit...
  
    cout &lt;&lt; &quot;Enter string to be inserted: &quot; &lt;&lt; endl;
    cin.getline(tempCString, 500, '\n'); //I've also tried cin.getline(tempCString, 500);
  
  //...end code snipit...
  
    return 0;
  }
  </code></pre>
  <p>note: I can't use &quot;cin &gt;&gt; tempCString&quot; becaues it will only get the input up to the first space, I need to get input from the console of everything up to the newline.</p>
  <p>Thank you</p>