title: how to apply a different function to each line of input
body: <p>I want to apply a different function to each line I read in from a file, but I can't figure out how.</p>
  
  <p>Here's what I've got. </p>
  
  <pre><code> while (input &gt;&gt; val)
   {
      cout &lt;&lt; val &lt;&lt;endl;
      input.get();
      input.ignore();
       addfirst(val);
       subsecond(val);
       addAllthird(val);
   }
  </code></pre>
  
  <p>Here's an example input file.</p>
  
  <pre><code>3, 5, 6, 7   
  4, -4    
  999, 777
  </code></pre>