c++ getline() function
<p>I dont' quite understand how this function works.</p>

<p>I wrote a simple programming reading one line with getline().</p>

<p>for example:</p>

<pre><code>ifstream in;
in.open("example.txt");
string line;
getline(in, line);
cout &lt;&lt; line &lt;&lt; endl;
</code></pre>

<p>When I tried to run this program I received an error message like this.</p>

<pre><code>`assign1_2.cpp:33:20: error: cannot convert 'std::string {aka std::basic_string&lt;char&gt;}'    to 'const char*' for argument '1' to 'int atoi(const char*)'
</code></pre>

<p>I simply don't understand what went wrong here. Please help!. I am a newbie to c++. </p>
