c++ - how to include class member function inside another class member function -
i need access class member function inside class member function, guess code reuse about. anyways have class , class header file. class has 1 member function calculate average of column in vector. need access average function in function instance datastandardization function below.
class.cpp has 2 member function below
float table::datatsandardization(int row, int col){ float tablevalue,avg=0; return avg; }
another member function calculate average:
float table::displaycolaverage(int col){ float sum=0.0,ave; for(register unsigned int i=0; i<vec.size(); i++) { sum = sum + vec[i][col]; } return ave=sum/vec.size(); }
now need include average function inside standardization function: example want this:
float table::datatsandardization(int row, int col){ float tablevalue,avg=0; avg = displaycolaverage(int col); return avg; }
thanks looking @ problem.
Comments
Post a Comment