Using dynamic multi-dimensional arrays in c++

后端 未结 6 524
礼貌的吻别
礼貌的吻别 2020-12-21 01:24

I am making a C++ program that checks if given aray is a latin square. I need to use a dynamic multi-dimensional array that stores given latin square. But I cant pass the ar

6条回答
  •  Happy的楠姐
    2020-12-21 01:54

    You have an array of pointers in lsquare.

    You might want to just do something like:

    lsquare = new int[n * n];
    

    That way you can then fill in this square, but the type is then:

    int *lsquare
    

提交回复
热议问题