I am doing some homework and I have finished the assignment apart from one part. I need to use a function that calcuates the average of all the passed grades. The grade total must be an integer based pointer ( for some bizzare reason ). The grades are integer. The below snippet compiles fine without error but when I run the debug and display the results I get 0.00 for the average.
I am thinking the problem is that I am assigning an integer based pointer to a double value? Would a static_cast be an option?
void GradeBook::calculateGradeAverage( double m_StudentAverage, int *pm_GradeTotal, const int SIZE )
m_StudentAverage = (*pm_GradeTotal) / SIZE;
I can post the full code if you need more info.
Thanks in advance.