title: 'Cannot convert 'float' to 'float*' for argument '1'
body: <p>I'm an ICT student, studying C++, and I find it very interesting. However, while experimenting, I came up to something I can't fix myself nor find on the net.
  This is the code:</p>
  
  <pre><code>    #include &lt;iostream&gt;
  
  using namespace std;
  
  
  float average(float array[10], float &amp;average){
        int i = 0;
  
        for( i = 0; i != 10; i++ ){
                  cout &lt;&lt; "Vett ("&lt;&lt;i&lt;&lt;") = ";
                  cin &gt;&gt; array[i];
                  while(cin.fail())
                  {
                                cin.clear();
                                cin.ignore();
                                system("Color 5C");
                                cout &lt;&lt; "\nPlease insert a number: ";
                                cin &gt;&gt; array[i];
                  }
                  average = average + array[i];
                  }
                  average = average / 10;
                  return array[10];
                  return average;
                  }
  
  main(void){
             float vett[10], media;
             int i;
             char loop;
  
             vett[10] = 0;
             media = 0;
  
  
             do{
             system("cls");
             system("Color 00");
             cout&lt;&lt;"****************************************"&lt;&lt;endl;
             cout&lt;&lt;"***     INSER THE DATA TO COMPUTE    ***"&lt;&lt;endl;
             cout&lt;&lt;"****************************************\n"&lt;&lt;endl;
  
           /*  for( i = 0; i != 10; i++ ){
                  cout &lt;&lt; "Vett ("&lt;&lt;i&lt;&lt;") = ";
                  cin &gt;&gt; vett[i];
                  while(cin.fail())
                  {
                                cin.clear();
                                cin.ignore();
                                system("Color 5C");
                                cout &lt;&lt; "\nPlease insert a number: ";
                                cin &gt;&gt; vett[i];
                  }
                  media = media + vett[i];
                  }
  
                  media = media / 10;
                  */
                  average(vett[10],media);
                  for( i = 0; i != 10; i++ ){
                       cout &lt;&lt; vett[i]&lt;&lt;"  ";
                       }
  
                  if(media == 0){
                           cout &lt;&lt; "\nATTENTION the average equals to = "&lt;&lt;media&lt;&lt;endl;
                           }
                  else{
                       cout &lt;&lt; "\nThe average is"&lt;&lt;media&lt;&lt;endl;
                       }
                       printf("\n");
                       cout &lt;&lt; "\nDo You want to continue? Y/N";
                       cin &gt;&gt; loop;
                       }
                       while(loop == 'Y' || loop == 'y');
                       system("pause");
                       }
  </code></pre>
  
  <p>For some reason I couldn't set in the 'average' function the array as a pointer (&amp;array), perhaps because the array is already a pointer. Nonetheless, removing it gives me the following error:</p>
  
  <pre><code>"Cannot convert 'float' to 'float*' for argument '1' to 'float average(float*,float&amp;)'
  </code></pre>
  
  <p>If I call the function this way</p>
  
  <pre><code>average(&amp;vett[10],media);
  </code></pre>
  
  <p>it works, but returns weird values in the array.
  As you can see, I commented the same thing I put in the function, which works perfectly, unless..I put it in a function. I assume I've done something wrong with the function call, can anybody help me understand?</p>