title: Error: basic_istream<char> to non-scalar type cxx11::string while using getline
body: <p>I just started a c++ class at my school and I am starting to learn the language. For one school problem I am trying to skip lines in a text file using getline. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  int main()
  {
  int np;
  ifstream fin("gift1.txt.c_str()");
  string s;
  fin &gt;&gt; np;
  string people[np];
  
  for(int counter = 0; counter == 1 + np; ++counter)
  {
      string z = getline(fin, s)
      cout &lt;&lt; z &lt;&lt; endl;
  }
  }
  </code></pre>
  
  <p>Every time I try to compile that I get the error</p>
  
  <blockquote>
    <p>gift1.cpp:22:21: error: conversion from 'std::basic_istream' to non-scalar type 'std::__cxx11::string {aka std::__cxx11::basic_string}' requested</p>
  </blockquote>
  
  <p>Is there any simple solution to this?</p>