Why is this function not working? Sigh...I am getting a warning....warning C4700: local variable 'lowest' used without having been initialized...but I did initialize it at the start...
Code:double average(int array[], int numts) { int lowest, total = 0, total2 = 0; double avg; for (int count = 0; count < numts; count++) total += array[count]; total2 = total - lowest; avg = total2 / numts; return avg; }



LinkBack URL
About LinkBacks



Try setting lowest to some value, say 0. 
), you know the minimum is always the 0th index of your array. since you have this, change your average function to skip this score, that is, start summing at the 1th index, not 0th, and divide by numts-1.