Home > Software engineering >  The function definitions
The function definitions

Time:09-24

There is a great god know how this change

Double mm (int x, int y)
{
Mm (x, y)=1;//expression must be modifiable lvalue
Return the mm (x, y);
}

CodePudding user response:

Double buf [10, 10];
Double mm (int x, int y)
{
Buf (x, y)=1;//expression must be modifiable lvalue
Return buf (x, y),
}

CodePudding user response:

Double CTerrainAlaDlg: : FractFlow (int x, int y, int, int j)
{
PointNumber temp.
Temp=MaxSlope (x, y);
If (finalDepth [x] [y] & gt; FinalDepth [I] [j])
{
If (I==temp. X& & J==temp. Y)//if you want to (x, y) mesh, water flow into the (I, j)
{
FractFlow (x, y, I, j)=1.0;

}
}
Return FractFlow (x, y, I, j);
}



Void CTerrainAlaDlg: : TCA_D8 * * TCA (double)
{
for (int i=1; I<=rows; I++)
{
for (int j=1; J<=the columns; J++)
{
If (TCA [I] [j]==0)//computing catchment area of each grid node
{
TCA [I] [j]=1.0;//unit grid area

For (int m=1; M & gt;=1; M++)
{
For (int n=2; N & gt;=1; N++)
{
Double P=FractFlow (I + m, j + n, I, j);
If (P & gt; 0)
{
TCA [I, j] +=P * TCA [I] [j];
}
}//n cycle end
}//m cycle end
}//if_1 judgment over
}//j loop end
}//I cycle end
}


Complete code, involve the recursive call, have what good method
  • Related