title: Swap function of elements in array
body: <p>the final task for me to perform is to swap the value of the first element of my array (array[0] with the last element of my array  (array[2]); however, whenever i compile i receive these three errors and cannot seem to fix them:</p>
  
  <pre><code>:4 redefinition of parameter 'array'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>:32 incompatible type for argument 1 of 'swap'
  :32 incompatible type for argument 2 of 'swap'
  </code></pre>
  
  <p>here is my code:</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
  
      void
      swap(double *array[0],double *array[2])
         {
         int temp = *array[0];
         *array[0] = *array[2];
         *array[2] = temp;
         }
     int
     main(int argc, char **argv)
         { 
  
         double array[3] = {0};
         double realNumber;
         printf("array[0] is %f\n",array[0]);
         printf("array[1] is %f\n",array[1]);
         printf("array[2] is %f\n",array[2]);
         printf("enter the first real number:\n");
         scanf("%lf",&amp;realNumber);
         array[0] = realNumber;
         printf("enter the second real number:\n");
         scanf("%lf",&amp;realNumber);
         array[1] = realNumber;
         printf("enter the third real number:\n");
         scanf("%lf",&amp;realNumber);
         array[2] = realNumber;
         printf("array[0] is %f\n",array[0]);
         printf("array[1] is %f\n",array[1]);
         printf("array[2] is %f\n",array[2]);
  
         swap(double array[0],double array[2]);
  
         printf("after swapping...\n");
         printf("array[0] is %f\n",array[0]);
         printf("array[1] is %f\n",array[1]);
         printf("array[2] is %f\n",array[2]);
         return 0;
         }
  </code></pre>