How to separate a column of numbers from string lines of varying lengths in C++?
<p>thanks in advance for your help.
I'm looking to read a file that has the following format:</p>

<pre><code>100      Every line has  
23452    A different number of words  
30       etc
</code></pre>

<p>If I use the method of reading line by line:</p>

<p>file >> number[i] >> str</p>

<p>It obviously doesn't work, because the string has spaces. Does anyone have any idea how else I could do this? I am only interested in saving the numbers in an array.
Thanks!</p>
