Hi there, I don't know if the answer to this has been posted before, but I'm having some problem calculating the Mode for a dynamic array in C++.
>
cout << "Enter the size of your array: ";
cin >> aSize;
int *newArray = new int[aSize];
runMode(newArray, aSize);
< this isi in my main
--------------------------------------
void runMode( int intArray[], int arraySize )
{
cout << "Enter in the numbers: ";
for (int i = 0; i < arraySize; i++)
{
cin >> intArray[i];
}//for loop for putting numbers into the array
}// runMore function
and that's the function I'm using, any ideas on how to calculate mode would be appreciated.
Thanks