title: problem with getline() function
body: <p>I am a beginner at C++ and I'm trying to use the getline() function for the first time.
  When I wrote this code, 2 errors showed up.</p>
  
  <p><strong>What is this code supposed to do?</strong>
  It is supposed to read 4 numbers from read.txt then calculate it to find the mean and write the output in output.txt. </p>
  
  <p>The 4 numbers (in read.txt) are all on separate lines like this:</p>
  
  <pre><code>6
  12
  15
  19
  </code></pre>
  
  <p><strong>Here is the code:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  using namespace std;
  
      int main () 
      {
       ifstream readFile;
          ofstream sendFile;
       readFile.open ("read.txt");
       sendFile.open ("output.txt");;
  
       float mean;
       int num, num2, num3, num4;
       getline(readFile, num), getline(readFile, num2), getline(readFile, num3), getline(readFile, num4); 
  
       readFile &gt;&gt; num &gt;&gt; num2 &gt;&gt; num3 &gt;&gt; num4;
       sendFile &lt;&lt; "1. The mean of " &lt;&lt; num &lt;&lt; ", " &lt;&lt; num2 &lt;&lt; ", " &lt;&lt; num3 &lt;&lt; ", and " &lt;&lt; num4 &lt;&lt; "is " &lt;&lt; (num + num2 + num3 + num4) / 4;
  
       readFile.close();
       sendFile.close();
  
        system ("PAUSE") ;
        return 0;
      }
  </code></pre>
  
  <p><strong>Here are the errors:</strong>
  IntelliSense: no instance of overloaded function "getline" matches the argument list 20
  IntelliSense: too few arguments in function call 20</p>