title: How to avoid " undefined reference to ... ' " when using arrays and functions?
body: <p>I'm learning how to use arrays as funtion arguments by making a program that does the following: </p>
  
  <ol>
  <li>Gets four test scores from the user and stores it in an array</li>
  <li>Calculates the sum of the scores in the array</li>
  <li>subtracts the lowest test score from the sum, and gives an adjusted sum</li>
  <li>Calculates the average from the adjusted sum, and prints out the average</li>
  </ol>
  
  <p>I found this program in a book called "starting out with c++"
  I seem to have followed the source code it provides to solve this problem but and error occurs and I don't understand where the problem is.</p>
  
  <p>Here is my incomplete source code: ( I am using code blocks )</p>
  
  <p>The error appears in line 20 :</p>
  
  <blockquote>
    <p>undefined reference to 'GetTotal(double const*, int)'</p>
  </blockquote>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  
  void GetScores(double[], int);
  double GetTotal(const double[], int);
  double GetLowest(const double[], int);
  
  int main()
  {
      const int SIZE = 4;
      double scOres[SIZE],//array holds scores
          total, // to store total test scores
          lowestScore, // to store lowest test score
          average;// to store average value
  
      GetScores(scOres , SIZE); //gets test scores from user
      GetTotal(scOres , SIZE); //sums up test scores
      GetLowest(scOres , SIZE); //gets lowest score
  
      return 0;
  }
  
  void GetScores(double scores[],int size)
  {
      for (int index = 0; index &lt; size; index++)
      {
          cout &lt;&lt; "Enter test score " &lt;&lt; index + 1 &lt;&lt; ":" ;
          cin &gt;&gt; scores[index];
      }
  }
  </code></pre>
  
  <h1>so how can I solve this problem?</h1>