C++ file reading
<p>I have a file that has a number in which is the number of names that follow. For example:</p>

<pre><code>4
bob
jim
bar
ted
</code></pre>

<p>im trying to write a program to read these names.</p>

<pre><code>void process_file(ifstream&amp; in, ofstream&amp; out)
{
    string i,o;
    int tmp1,sp;
    char tmp2;
    prompt_user(i,o);
    in.open (i.c_str());

    if (in.fail())
    {
        cout &lt;&lt; "Error opening " &lt;&lt; i &lt;&lt; endl;
        exit(1);
    }

    out.open(o.c_str());
    in &gt;&gt; tmp1;
    sp=tmp1;

    do
    {
        in.get(tmp2);
    } while (tmp2 != '\n');

    in.close();
    out.close();
    cout&lt;&lt; sp;
}
</code></pre>

<p>So far I am able to read the first line and assign int to sp</p>

<p>I need sp to be a counter for how many names. How do I get this to read the names.
The only problem I have left is how to get the names while ignoring the first number.
Until then i cannot implement my loop.</p>
