title: Why is the pointer not de-referenced in the function max?
body: <pre><code>// function t find the max value entered in the array
      double max(double *n,int size)
      {
          int i,k=0;
          double *maxi;
          maxi=&amp;k;
  
          for(i=0;i&lt;size;i++)
          {
              if(*maxi&lt;n[i])
              {
                  maxi=&amp;n[i];
              }
          }
          return *maxi;
      }
  //elements of array are added
      main()
      {
          double a[10000],maxi;
          int size,i;
          printf("enter the size of the array");
          scanf("%d",&amp;size);
          printf("enter the elements of array");
          for(i=0;i&lt;size;i++)
          {
              scanf("%lf",&amp;a[i]);
          }
          maxi=max(&amp;a,size);
          printf("maximum value is %lf",maxi);
      }
  </code></pre>
  
  <p>Why is the pointer not de-referenced in the function max? If I de-reference the pointer <code>n</code> it gives an error. If there is a better way to do this, please suggest.</p>