Incorrect Average

I am supposed to get numbers from an input file and display the average. The problem is I keep getting 0 as my average and that's incorrect.
Last edited on
Nowhere do you increment counter, or call calcAvg().
As Ganado said:
*You need to increment counter in your readFile function, inside the while loop.
*You need to call calcAvg in your main function after readFile and before closeFile


however, I don't understand exactly what you mean by calling it in my main function, I thought I had already called it here:

Last edited on
You defined it there.

You should read the function tutorial: http://www.cplusplus.com/doc/tutorial/functions/
Topic archived. No new replies allowed.