I am stuck in the following program. Try to be nice, I'm new at this! I am needing to return the actual number that occurs the most times in an array. I have figured out which one that is, but can't seem to display it correctly. I've read, and reread my book on the subject concerning pointers (the chapter the problem is from). I still don't understand. I know I need to find the array subscript which correlates to the most reoccuring number. Please HELP!!!
int findCommon(int array,int aray,int number);
cout<<"How many grades do you want to enter?<more than one please.>";
grades=new int [numGrades];
freq= new int[numGrades];
cout<<"Grade "<<(count+1)<<": ";
for (int index=0;index<numGrades;index++)
cout<<"The mode is: "<< findCommon(grades,freq , numGrades)<<endl;
int findCommon(int grades, int freq,int numGrades)
for (int compare=0;compare<=numGrades;compare++)
if (grades[number] == grades[compare])
for (int k=0;k<=numGrades; k++)
if (most < freq[k])
//problem area: set most to original array????
I know this is probably an easy one for anyone helping, but I' ve been staring at it too long, and my teacher can't show me.