title: Taking char type name using getline in structure
body: <p>As I declared a structure array: struct name data[5];
  When I try to take input using cin.getline(data[i].full_name,75) (which I need) then after first time it skips the char input. I searched on this site and used fgets but was of no use.
   The code is :</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  struct name
  {
     char full_name[75];
     int number; 
  };
  
  void input(struct name data[])
  {
     int i=0;
     while(i&lt;5)
     {
        cout&lt;&lt;"Enter the name: ";
        fgets(data[i].full_name,75,stdin);
                     OR
        cin.getline(data[i].full_name,75)
  
  
        cout&lt;&lt;"Enter the number: ";
        cin&gt;&gt;data[i].number;
        i++;
     }
  }
  
  int main()
  {
      int times=0;
      struct name data[5];
      input(data);    
  }
  </code></pre>