C++ 通过两个下标访问数组成员

C++ 通过两个下标访问数组成员,c++,C++,我已将矩阵的成员存储到一维数组中。现在的问题是,我需要通过2索引符号访问这些成员,如下所示: int matrix[2][3] = {{ 1 , 2 , 3 },{ 4, 5 , 6 }}; // this is no longer available int x , y; //Stored matrix data on array[] int array[] = {1,2,3,4,5,6}; // only this member available cout

我已将矩阵的成员存储到一维数组中。现在的问题是,我需要通过2索引符号访问这些成员,如下所示:

int matrix[2][3] = {{ 1 , 2 , 3 },{ 4, 5 , 6 }}; // this is no longer available
    int x , y;
    //Stored matrix data on array[]
    int array[] = {1,2,3,4,5,6}; // only this member available

    cout << "Insert the x index : ";
    cin>> x;
    cout << "Insert the y index : ";
    cin>> y;
array[row * columnSize + column]
int矩阵[2][3]={{1,2,3},{4,5,6};//这已不再可用
int x,y;
//数组[]上存储的矩阵数据
int数组[]={1,2,3,4,5,6};//只有此成员可用
cout>x;
cout>y;
那么,如何打印存储在中的矩阵[1][1]成员
在数组[]?

上,自己计算索引,如下所示:

int matrix[2][3] = {{ 1 , 2 , 3 },{ 4, 5 , 6 }}; // this is no longer available
    int x , y;
    //Stored matrix data on array[]
    int array[] = {1,2,3,4,5,6}; // only this member available

    cout << "Insert the x index : ";
    cin>> x;
    cout << "Insert the y index : ";
    cin>> y;
array[row * columnSize + column]