title: c++ cannot convert 'double' to 'double*' for argument 1 to 'void sort(double*,int)' error
body: <p>I'm a student listening to c programming lesson, and I'm using c++ to 'call-by-reference'. I don't know how to use c++ exactly, so I use c and save it into .cpp file. Anyway, I used a function to sort an array, and I now have an error. What should I do to solve this error?  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  double round(double value);
  void sort(double a[],int cnt);
  void swap(double&amp; x,double&amp; y);
  
  int main()
  {
      int i;
      double array[3];
      for(i=0;i&lt;3;i++){
      scanf("%lf",&amp;array[i]);
      }
      sort(array[3],3);
      printf("%d %d %d",ceil(array[0]),floor(array[2]),round(array[1]));
      return 0;
  }
  
  double round(double value)
  {
      return floor(value+0.5);
  }
  
  void sort(double a[],int cnt)
  {
      int i,j;
      for(i=0;i&lt;cnt-1;i++){
          for(j=i+1;j&lt;cnt;j++){
                  if(a[i]&lt;a[j]){
                      swap(a[i],a[j]);
                  }
              }
          }
  }
  
  void swap(double&amp; x,double&amp; y)
  {
      int imsi=x;
      x=y;
      y=imsi;
  }
  </code></pre>