title: Issue with C++ and cin.getline
body: <p>I'm learning <code>struct</code> in C++ and I don't know how to make it not to jump over the first question.</p>
  <p>If I'm using char in the <code>struct</code> it will only copy me the first word, if I'm trying to use string it jumps over the first question (ignoring it).</p>
  <p>Could you please guide me?</p>
  <p>Later edit:
  I use Microsoft Visual C++ 2010 express edition, and is there a difference between <code>std::getline</code> and <code>cin.getline</code>?</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  #include &lt;string&gt;
  
  
  using namespace std;
  
  
  struct melodie{
  
  char artist[50];
  char titlu[50];
  int an;
  int lungime;
  
  };
  
  void main(){
  int repetam;
  double rezultat;
  cout&lt;&lt;&quot;Cate melodii veti introduce: &quot;;
  cin&gt;&gt;repetam;
  melodie *pointer = new melodie[repetam];
  for(int i = 0; i&lt;repetam; i++){
      cout&lt;&lt;endl;
      cout&lt;&lt;&quot;Introduceti artistul melodiei: &quot;;    
      cin.get(pointer[i].artist);
      cout&lt;&lt;&quot;Introduceti titlul melodiei: &quot;;
      cin.getline(pointer[i].titlu);
      cout&lt;&lt;&quot;Introduceti anul melodiei: &quot;;
      cin&gt;&gt;pointer[i].an;
      cout&lt;&lt;&quot;Introuceti lungea melodiei (in secunde): &quot;;
      cin&gt;&gt;pointer[i].lungime;
  
  
  }
  cout&lt;&lt;&quot;Lista melodiilor introduse este:&quot;&lt;&lt;endl;
  for(int i =0; i&lt;repetam; i++){
      cout&lt;&lt;&quot;Artistul melodiei este: &quot;&lt;&lt;pointer[i].artist&lt;&lt;endl
          &lt;&lt;&quot;Titlul melodiei este: &quot;&lt;&lt;pointer[i].titlu&lt;&lt;endl
          &lt;&lt;&quot;Anul melodiei este: &quot;&lt;&lt;pointer[i].an&lt;&lt;endl
          &lt;&lt;&quot;Lungimea melodiei (in secunde) este: &quot;&lt;&lt;pointer[i].lungime&lt;&lt;endl;
      cout&lt;&lt;endl;
  }
  
  cout&lt;&lt;&quot;Melodiile care au aparut dupa anul 2000 si au lungimea mai mica de 180 de secunde sunt: &quot;&lt;&lt;endl;
  for(int i = 0;i&lt;repetam; i++){
      if(pointer[i].an&gt;2000 &amp;&amp; pointer[i].lungime&lt;180){
          cout&lt;&lt;&quot;Artist: &quot;&lt;&lt;pointer[i].artist
              &lt;&lt;endl
              &lt;&lt;&quot;Titlul: &quot;&lt;&lt;pointer[i].titlu&lt;&lt;endl&lt;&lt;endl;
  
          
      }
  }
  
  
  
  getch();
  }
  </code></pre>