title: EASY C Max Array Element program -> CANNOT find/understand the error
body: <p>I have written this program which finds the index of the largest element, in an array of integers. For some reason I am getting the following errors when I try compiling it. Any ideas on what is wrong with my code? I cannot seem to find anything.</p>
  
  <pre class="lang-none prettyprint-override"><code>part1.c:9: error: expected ‘;’, ‘,’ or ‘)’ before numeric constant
  
  part1.c: In function ‘main’:
  
  part1.c:13: warning: implicit declaration of function ‘largest’
  
  part1.c: At top level:
  
  part1.c:20: error: expected ‘;’, ‘,’ or ‘)’ before numeric constant
  make: *** [part1] Error 1
  </code></pre>
  
  <p>My Code:</p>
  
  <pre><code>// Program that finds the largest element in an array of integers 
  
  #include &lt;stdio.h&gt;
  
  // Main body
  // Create and initialise a one-dimensional array of integers
  
  #define ARRAY_SIZE 10
  int largest(int array, int ARRAY_SIZE);
  int main(int argc, char** argv)
  {
    int array [ARRAY_SIZE] = { 5, 1, 2, 8, 12, 9, 0, 4, 52, 91 };
    int maxIndex = largest(array, ARRAY_SIZE);
    printf("%d", maxIndex);
  }
  
  // largest - function
  // takes (array,length) -&gt; returns the index of the largest element in the array
  
  int largest(int array, int ARRAY_SIZE)
  {
     int maxIndex;
  
     for(int index = 0; index &lt; 10; index++)
     {
       if array[i] &gt; array[i+1]
       i = maxIndex;  
     }
  
     return maxIndex; 
  
  }
  </code></pre>