Reading getline from cin into a stringstream (C++)
<p>So I'm trying to read input like this from the standard input (using <code>cin</code>):</p>

<blockquote>
  <p>Adam English 85<br>
      Charlie Math 76<br>
      Erica History 82<br>
      Richard Science 90</p>
</blockquote>

<p>My goal is to eventually store each data piece in its own cell in a data structure I have created, so basically I want to parse the input so each piece of data is individual. Since each row of input is inputted by the user one at a time, each time I get an entire row of input that I need to parse. Currently I am trying something like this:</p>

<pre><code>stringstream ss;
getline(cin, ss);

string name;
string course;
string grade;
ss &gt;&gt; name &gt;&gt; course &gt;&gt; grade;
</code></pre>

<p>The error I am having is that XCode is telling me there's no matching function call to <code>getline</code> which is confusing me. I have included the <code>string</code> library, so I'm guessing the error has to do with using <code>getline</code> to read in from <code>cin</code> to a <code>stringstream</code>? Any help here would be appreciated.</p>