Maximum Minimum in Array in C (with pointers)
<p>I have a problem, when I run it, the minimum and maximum don't appear properly.
Any suggestions?
I have to make the range appear.
I tried it with pointers.
The Exercises could be done otherwise for sure but I want to understand my mistakes with this way. </p>

<pre><code>#include &lt;stdio.h&gt;
#include "simpio.h"
#include "genlib.h"

int readArray(int array[100]);

main()
{
  int array[100], i, size, *min, *max;

  printf("Enter the elements of the array, one per line.\n");
  printf("Use -1 to signal the end of the list.\n");

  readArray(array);

  min = array;
  *min = *array;

  for (i=1; i&lt;size; i++)
  {
    if ( *(array+i) &lt; *min )
    {
      *min = *(array+i);
    }
  }
  max = array;
  *max = *array;

  for (i=1; i&lt;size; i++)
  {
    if ( *(array+i) &gt; *max )
    {
      *max = *(array+i);
    }
  }

  printf("The range of values is %d-%d \n", *min, *max);

  system("pause");
}

int readArray(int array[100])
{
  int i, size;
  size = 0;

  for (i=0; i&lt;100; i++)
  {
    printf("? ");
    array[i] = GetInteger();
    size += 1;
    if (array[i] == -1) {break;}
  }
  for(i=0; i&lt;size-1; i++)
  {
    printf("%d ", array[i]);
  }
  printf("\n");

  printf("\n");
}
</code></pre>