1. ## Stuck!!

Hello,
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!!!

[code]

#include <iostream.h>
#include <iomanip.h>

//Function prototype

int findCommon(int array[],int aray[],int number);

int main(void)
{
int *freq;

{

}

{
}
cout<<endl;
return 0;

}

{

int count=0;
{

{

{
count=count+1;
}
}
freq[number]=count;
count=0;
}
int most=freq[0];

{
if (most < freq[k])
{
most=freq[k];
}

}

return freq[most];
//problem area: set most to original array????

}
[\code]

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.
Thanks,
George

 I see you're only a character out.... wrong type of slash on the closing code tag. Good try

3. I just looked over your code quickly, but try using 'return most;', because you are assigning it the value of the most largest element of freq, not the index.

4. wow this is messy..
hmm here is an edited version of your code..
I dont have time to test/compile it. so dont blame me if doesnt work..

Code:
``` #include <iostream>       //dont use .h use iso headers
#include <iomanip>
using namespace std;

int findCommon(int array[],int aray[],int number);

int main(void)
{
int *freq;

{
cin>>grades[count];    // I think this is what u meant?

}

{
}
return 0;

}

{

int count=0;
{

{

{
count++;
}
}
freq[number]=count;
count=0;
}
int most=freq[0];

{
if (most < freq[k])
{
most=freq[k];
}

}

return freq[most];

}```
Luigi

5. I think this is your error:

change
Code:
```         for (int k=0;k<=numGrades; k++)
{
if (most < freq[k])
{
most=freq[k];
}

}
return freq[most];```
to
Code:
```         int index=0;