title: What's wrong with this C program using pointer function
body: <p>When i assign a variable for the pointer function, the program crashes when i run it, but if i print it right away it doesnt (printf("%d",*Largest(parr,10));)</p>
  
  <p>This outputs the address of the largest element in the array</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int *Largest(int*,int);
  
  int main (void)
  {
      int arr[10] = {33,7,1,3,8,5,2,10,39,22},*parr,z;
  
      parr=arr;
      z = *(Largest(parr,10));
      printf ("%d",z);
  }
  
  int *Largest (int *array, int size)
  {
      int i,*high;
  
      *high = 0;
  
      for (i=0;i&lt;size-1;i++)
          if (array[i] &lt; array[i+1]) *high = i+1;
          else *high = i;
  
      return high;
  }
  </code></pre>