Operation PRI

来源:互联网 发布:地效飞行器 知乎 编辑:程序博客网 时间:2024/04/27 04:36

While doing EX22PG199 in the book written by Paul.Kelly, I want to take out the value in an two dim array using the following code:

fElementOfMatrixA=*(float*)ppMatrixA + MatrixA.Cols*i + k;

it doesn't work properly,because the last step is to plus the value with k,the address will be wrong.

the right code should be:

fElementOfMatrixA=*((float*)ppMatrixA + MatrixA.Cols*i + k);

that will access the right value in array[i][k]