title: Error: invalid conversion from 'int' to 'int*' [-fpermissive]
body: <p>compiler error :[Error] invalid conversion from 'int' to 'int*' [-fpermissive]
  could someone please help me , and tell me why my programme is giving me this error ?</p>
  
  <p>the faulty code :</p>
  
  <pre><code>cout&lt;&lt;"Mode score: "&lt;&lt;printModeValues(scorePtr,size,modeFrequency(scorePtr,size));
  </code></pre>
  
  <p>my code:
  Main:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include "processScores.h"
  
  int main()  {
      int * scorePtr;
      string * namePtr, scoresFileName;
  
      cout&lt;&lt;"Enter the file name: ";
      cin&gt;&gt;scoresFileName;
  
      unsigned size=getRecordsNumber(scoresFileName);
      scorePtr = new int[size];
      namePtr = new string[size];
  
      readRecords(scorePtr,namePtr,scoresFileName);
      sort(scorePtr,namePtr,size);
  
      cout&lt;&lt;"The records in ascending order of surnames are: \n";
      cout&lt;&lt;"Name          Score\n";
      cout&lt;&lt;"---------------------"&lt;&lt;endl;
      printScores(scorePtr,namePtr,size);
  
      cout&lt;&lt;endl;
      cout&lt;&lt;"Highest score: "&lt;&lt;highest(scorePtr,size)&lt;&lt;"\t";
      printFoundNames(scorePtr,namePtr,size,highest(scorePtr,size));
      cout&lt;&lt;"Lowest score: "&lt;&lt;lowest(scorePtr,size)&lt;&lt;"\t";    
      printFoundNames(scorePtr,namePtr,size,lowest(scorePtr,size));
      cout&lt;&lt;"Mean score: "&lt;&lt;mean(scorePtr,size)&lt;&lt;endl;
      cout&lt;&lt;"Mode score: "&lt;&lt;printModeValues(scorePtr,size,modeFrequency(scorePtr,size));
      cout&lt;&lt;"Modal value occurrences is "&lt;&lt;modeFrequency(scorePtr,size)&lt;&lt;" time\n"&lt;&lt;endl;
      cout&lt;&lt;"Median score: "&lt;&lt;median(scorePtr,size)&lt;&lt;endl; 
      delete [] scorePtr;
      delete [] namePtr;
  }
  </code></pre>
  
  <p>the header file:</p>
  
  <pre><code>void printModeValues(const int *, size_t, int[]);
  </code></pre>
  
  <p>function prototype:</p>
  
  <pre><code>//**** MODE FREQUENCY ****
  int modeFrequency(const int * scores, size_t size)
  {
      int y[size] , modes[size];//Sets all arrays equal to 0
      int i,j,k,m,a,cnt,count=0,max=0,no_mode=0,mode_cnt=0;
      double num;
  
      for(k=0; k&lt;size; k++)//Loop to count an array from left to right
      {
          cnt=0;
          num=scores[k];//Num will equal the value of array x[k]
  
          for(i=k; i&lt;size; i++)//Nested loop to search for a value equal to x[k]
          {
              if(num==scores[i])
                   cnt++;//if a number is found that is equal to x[k] count will go up by one
  
          }
  
          y[k]=cnt;//The array y[k] is initialized the value of whatever count is after the nested loop
  
          if(cnt&gt;=2)//If cnt is greater or equal to two then there must be atleast one mode, so no_mode goes up by one
          {
              no_mode++;
          }
      }
  
  if(no_mode==0)//after the for loops have excuted and still no_mode hasn't been incremented, there mustn't be a mode
  {
      //Print there in no mode and return control to main
      modes[1]=-1;
     // return modes;
  }
      for(j=0; j&lt;size; j++)
  //A loop to find the highest number in the array
      {   
          if(y[j]&gt;max)
          max=y[j];
      }
   for(m=0; m&lt;size; m++)//This loop finds how many modes there are in the data set
  {
      //If the max is equal to y[m] then that is a mode and mode_cnt is incremeted by one
      if(max==y[m])
          mode_cnt++;
  }
  //cout&lt;&lt;"This data set has "&lt;&lt;mode_cnt&lt;&lt;" mode(s)"&lt;&lt;endl;//Prints out how many modes there are
      for(m=0; m&lt;size; m++)
      {
          if(max==y[m])//If max is equal to y[m] then the same sub set of array x[] is the actual mode
          {
  
              cout&lt;&lt;"The value "&lt;&lt;scores[m]&lt;&lt;" appeared "&lt;&lt;y[m]&lt;&lt;" times in the data set\n"&lt;&lt;endl;
              modes[count]=scores[m];
              count++;
          }
      }
  return *modes;
  }
  //=====================================================================================
  //**** PRINT MODE VALUE ****
  void printModeValues(const int *scores, size_t size, int *mostAppearance)
  {
      if (mostAppearance[0]== -1)
      {
          cout&lt;&lt;"-1 Modal value occurance is one time "&lt;&lt;endl;
      }
      else
      {
          for (int a=0 ; a&lt; sizeof(mostAppearance); a++)
          {
              cout&lt;&lt;mostAppearance[a]&lt;&lt;" ";
          }
          cout&lt;&lt;endl; 
      }
  }
  </code></pre>