How to create 2d array c++?

后端 未结 5 2080
无人共我
无人共我 2020-12-10 21:05

I need to create 2d array in c++.

I can\'t do it by int mas= new int[x][y]; or auto mas= new int[x][y]; I need to create an array dynamical

5条回答
  •  星月不相逢
    2020-12-10 21:21

    int x,y;
    x =3;
    y = 5;
    int ** mas = new int*[x];
    for (int i=0;i

    I think something like this. Don't forget

    for(int i=0;i

    at the end.

提交回复
热议问题