How to read CSV file with C++
<p>I have a csv file with the following information on each line:</p>

<pre><code>John,Doe,17
</code></pre>

<p>The ifstream object name is inFile and I tried:</p>

<pre><code>string firstName;
string lastName;
int age;
inFile &gt;&gt; firstName &gt;&gt; "," &gt;&gt; lastName &gt;&gt; "," &gt;&gt; age
</code></pre>

<p>However, clearly, i cannot do <code>&gt;&gt; "," &gt;&gt;</code></p>

<p>How do I correctly get those values and use them?</p>

<p>Thank you.</p>