How to pass a function that returns some value from one class as a variable in a function defined in another class. At the moment my code looks like this:
float A::decay(){ B b; float N; const int HL=946; const int G=126; float T; if(b.min()>0){ T=(float)(b.min()-G)/HL; N=pow(2,-T); } return N; } int B::min(){ int min=dtim[0][0][0]; for(int i=0;i<N;i++){ for(int j=0; j<K; j++){ for(int q=0; q<L; q++){ if (dtime[i][j][q] < min)min = dtime[i][j][q]; } } } return min; }
When trying to call the min () function in decay (), min is always zero.