二维数组参数怎么传好?# JobHunting - 待字闺中
s*f
1 楼
used for interview.
I don't mean this:
void foo(int m[][const_num])
I want to deal with any size, not just <=const_num.
or this: vector > &vv;
or this: void foo(int *m, int row, int col){m[i * row + j] = ...;}
or this: void foo(int **m)? this cannot accept int m[5][5];
I don't mean this:
void foo(int m[][const_num])
I want to deal with any size, not just <=const_num.
or this: vector
or this: void foo(int *m, int row, int col){m[i * row + j] = ...;}
or this: void foo(int **m)? this cannot accept int m[5][5];