title: ld returned 1 error exit status C++
body: <p>I keep getting "undefined reference to 'x'" where x is the function prototypes. I have the functions mapped out but the main still needs work just fyi. I just want to fix the ld return error 1 before pressing on but I can't seem to pin point the issue.</p>
  
  <pre><code> #include &lt;iostream&gt;
  
   #include &lt;iomanip&gt;
  
   #include &lt;cmath&gt;
  
  using namespace std;
  
  //Symbolic Constants
  
  const int MAX=11;
  
  //Function Prototypes
  
  int buildQuizArray(int);
  void printArray(string,int,int);
  double calcQuizAverage(int,int);
  void sortArray(int,int);
  
  int main ()
  
  {
  
      int quizScores[MAX];
      int compQuiz;
      int tempArray[MAX];
      int average;
  
      compQuiz = buildQuizArray(quizScores[MAX]);
  
      quizScores[MAX]=tempArray[MAX];
  
      average = calcQuizAverage(quizScores[MAX], compQuiz);
  
      cout&lt;&lt;endl&lt;&lt;"Your quiz average is "&lt;&lt;average&lt;&lt;endl;
  
      printArray ("Quiz Scores", tempArray[MAX], compQuiz);
  
      sortArray(tempArray[MAX], compQuiz);
  
  }
  
  
  
  int buildQuizArray(int quizArray[])
  
  { 
  
      int numQuiz, input, a;
      a=0;
      numQuiz=1;
  
      cout &lt;&lt; "Enter your score for quiz "&lt;&lt;numQuiz&lt;&lt;" (-1 to quit): ";
      cin &gt;&gt; input;
  
      while (input != -1)
      { 
          quizArray[a] = input;
          a++;
          numQuiz++;
  
          cout&lt;&lt; "Enter your score for quiz "&lt;&lt;numQuiz&lt;&lt;" (-1 to quit): ";
          cin &gt;&gt; input;
  
      } 
      return a+1;
  } 
  
  
  
  void printArray(string reportTitle, int quizArray[], int numberOfQuizzes)
  
  { 
  
      int a;
  
      cout&lt;&lt; reportTitle &lt;&lt;endl&lt;&lt;"-----------"&lt;&lt;endl;
  
      for (a=0; a&lt;numberOfQuizzes; a++)
      {
          cout&lt;&lt; "Quiz " &lt;&lt; a &lt;&lt;": " &lt;&lt; setw(2) &lt;&lt;quizArray[a] &lt;&lt;"/10"&lt;&lt;endl;
      }
  } 
  
  
  
  double calcQuizAverage(int quizArray[], int numberOfQuizzes) 
  
  { 
  
      int sum, lowSum, avg, a;
      a = 0;
      sum = 0;
  
      lowSum = quizArray[0] + quizArray[1];
  
      for (a=0; a&lt; numberOfQuizzes; a++)
      {
          sum += quizArray[a];
      }
  
      if (numberOfQuizzes &lt;= 2)
      {
          avg = sum / (10 * numberOfQuizzes) * 100;
      }
  
      else
      {
          (sum - lowSum) / (10 * (numberOfQuizzes - 2)) * 100;
      }
  
      return avg;
  } 
  
  
  
  void sortArray(int quizArray[], int numberOfQuizzes) 
  
  { 
  
      int min, a, b, temp;
  
      for (a=0; a&lt;numberOfQuizzes; a++) 
      {
          min = a;
      }
  
      for(b=a+1; b&lt;numberOfQuizzes; a++) 
      { 
  
          if (quizArray[a] &lt; quizArray[min]) 
          {
              min = b;
          }
      } 
  
      temp = quizArray[a]; 
      quizArray[a]=quizArray[min]; 
      quizArray[min]=temp; 
  }
  </code></pre>