title: Problem with std::getline() and std::cin.get()
body: <p>can you help me
  Why this code can't be swap</p>
  <pre><code>    cout &lt;&lt; &quot;Enter a string: &quot;;
      getline(cin, str1);
  
      cout &lt;&lt; &quot;Enter another string: &quot;;
      cin.get(str, 100, '\n');
  </code></pre>
  <p>Into</p>
  <pre><code>    cout &lt;&lt; &quot;Enter  string: &quot;;
      cin.get(str, 100, '\n');
  </code></pre>
  <pre><code>    cout &lt;&lt; &quot;Enter a string: &quot;;
      getline(cin, str1);
  </code></pre>
  <p>when i ran
  First code
  Output :</p>
  <pre><code>Enter a string: hai
  Enter another string: hello
  </code></pre>
  <p>Second code
  Output :</p>
  <pre><code>Enter another string: hello
  Enter a string:
  </code></pre>
  <p>I can't input anymore, it just directly returned 0</p>
  <p>Is it because of delimiters?</p>