title: error: invalid types 'double*[double]' for array subscript
body: <p>I'm trying to create a programme which will place all of the real numbers in an array - with the ordering of the numbers taking place in a separate function - into descending order, and print them out.</p>
  
  <p>The following is the programme as I have it so far, but there are 2 issues with it, according to the compiler:
  (i) On line 22 (<code>"return N[t];"</code>), I get "<code>error: invalid types 'double*[double]' for array subscript</code>".<br>
  (ii) On line 28 ("<code>cout &lt;&lt; sort_array(Q[100]) &lt;&lt; " " "</code>), I get "<code>error: cannot convert 'double' to 'double*' for argument '1' to 'double* sort_array(double*)'</code>".</p>
  
  <p>I'm not quite understanding why these two errors are coming up, but I would love some help in resolving them.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  double *sort_array (double *N) {
  double t;
      int size=100, a, b;
  
  for (t=0; t&lt;size; t++)
          *N = rand()%250;
  
      for (a=1; a&lt;size; a++) {
          for (b=size-1; b&gt;=a; b--) {
              if (N[b-1] &lt; N[b]) {
                  t = N[b-1];
                  N[b-1] = N[b];
                  N[b] = t;
              }
          }
      }
      return N[t];
  }
  
  int main()
  {
      double Q[100];
          cout &lt;&lt; sort_array(Q[100]) &lt;&lt; " ";
          cout &lt;&lt; endl;
  
  
      return 0;
  }
  </code></pre>