你会如何使用两个维度来解决一维记忆?(如所获得的价值Matrix::ValueAt(row, col)
,其中Matrix
存储该值作为一门维阵列(float m[16]
对于4×4矩阵).
class Matrix4x4
{
private float m[16];
float getValueAt(int row, int col)
{
// I want this function
}
}
Run Code Online (Sandbox Code Playgroud)