Read from file with getline in a string then split the numbers from the string in int array
<p>I'm trying to read from a .txt file some numbers separted by white space. ( max 4 numbers on a line).</p>

<ul>
<li>I get the line but how can I transform it into array of int then
after I move to the second line to overwrite the array?</li>
</ul>

<p>Example:
.txt file</p>

<pre><code>2 5 8 14 11
50 40 30 20 10
18 17 16 15 14
</code></pre>

<p>Code:</p>

<pre><code>fstream f("C:\\n.txt");
string wtf;
int n;
while(f&gt;&gt;n)
{
getline(f,wtf);
//transform the wtf string into int array?
//do what ever...
//clear the array?
}
</code></pre>
