Code:
void sortMiddle(float myList[10], float middle, float inferior[10], float superior[10])
{
int counter1=0, counter 2=0, counter 3=0;
while (counter1<10)
{
if (myList[counter1] <= middle)
{
inferior[counter2]=myList[counter1];
counter2++;
}
else
{
superior[counter3]=myList[counter1];
counter3++;
}
counter1++;
}
}
Ive been reading through this code and there are a few things I dont understand now. I thought the mean value worked out would be stored in the meanValue, is this correct?
However in the second part of the code (above) there are no checks to see if the number read in the myList is bigger or smaller than this. It is only checked against middle, and middle doesnt seem to be assigned a value.