title: C++ Functions & Arrays - Error C4700 in Visual Studios
body: <p>I have a question about Arrays and Functions. This is the instructions that pertain to the part I've finished:</p>
  
  <p>During the semester, students in a computer science course take 4 tests.In order to calculate a student's
  course grade, the lowest test score is dropped.Only the top 3 test scores are used to determine the letter
  grade.Using arrays, create a program that uses the data located in the scores.txt to return the letter grade
  for each student as follows :</p>
  
  <ol>
  <li>Create a function named dropped_test() - that determines the lowest test score for each student.</li>
  </ol>
  
  <p>So when I try to debug it im getting error #C4700 saying that an uninitialized variable has been used - "low" on the line where I call the dropped_test function. Can anyone help me? I am very lost and don't know what to do. Thank you.</p>
  
  <p>{</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;fstream&gt;
  #include&lt;iomanip&gt;
  #include&lt;string&gt;
  
  using namespace std;
  
  //Prototypes.
  void dropped_test(int low, int T1[], int T2[], int T3[], int T4[], int i);
  
  int main() {
      //Declares
      ifstream fin;
      ofstream fout;
      string name[100];
      int T1[100], T2[100], T3[100], T4[100], low;
      int i = 0;
      int sumT;   //Sum of the test scores after dropped test
      int percent;
      char grade;
      int sumT1 = 0, sumT2 = 0, sumT3 = 0, sumT4 = 0, sumTotal = 0;   //Running sums of the test scores for each column
  
  
      //Open the files.
      fin.open("scores.txt");
      fout.open("grades.txt");
  
      //Test if files opened.
      if (fin) {
          cout &lt;&lt; "Processing..." &lt;&lt; endl;
          cout &lt;&lt; endl;
      }
      else {
          cout &lt;&lt; "ERROR ID107: File not found." &lt;&lt; endl;
          cout &lt;&lt; endl;
          system("pause");
          return 0;
      }
  
      //Remove the header.
      fin.ignore(100, '\n');
  
      //Input the data.
      while (!fin.eof()) {
          getline(fin, name[i], ',');
          fin &gt;&gt; T1[i];
          fin.ignore(5, ',');
          fin &gt;&gt; T2[i];
          fin.ignore(5, ',');
          fin &gt;&gt; T3[i];
          fin.ignore(5, ',');
          fin &gt;&gt; T4[i];
          fin.ignore();
      }
  
      //Calculate the lowest score.
      /*low = T1[i];
      if (low &gt; T2[i])
          low = T2[i];
      if (low &gt; T3[i])
          low = T3[i];
      if (low &gt; T4[i])
          low = T4[i];*/
  
      //Dropped Test
      dropped_test(low, T1, T2, T3, T4, i);
  
      //Calculate the sum of the test scores.
      sumT = T1[i] + T2[i] + T3[i] + T4[i] - low;
  
      //Calculate the test grade.
      percent = sumT / 3;
      if (percent &gt;= 90)
          grade = 'A';
      else if (percent &gt;= 80)
          grade = 'B';
      else if (percent &gt;= 70)
          grade = 'C';
      else if (percent &gt;= 60)
          grade = 'D';
      else
          grade = 'F';
  
      //Calculate the running sums.
      sumT1 = sumT1 + T1[i];
      sumT2 = sumT2 + T2[i];
      sumT3 = sumT3 + T3[i];
      sumT4 = sumT4 + T4[i];
      sumTotal = sumTotal + sumT;
  
      cout &lt;&lt; "Testing." &lt;&lt; endl;
  
      //Close files.
      fin.close();
      fout.close();
  
      system("pause");
      return 0;
  }
  
  void dropped_test(int low, int T1[], int T2[], int T3[], int T4[], int i = 0) {
      low = T1[i];
          if (low &gt; T2[i])
      low = T2[i];
          if (low &gt; T3[i])
      low = T3[i];
          if (low &gt; T4[i])
      low = T4[i];
          i++;
  }
  </code></pre>