Declaring a pointer to multidimensional array and allocating the array

前端 未结 6 432
名媛妹妹
名媛妹妹 2020-12-02 10:32

I\'ve tried looking but I haven\'t found anything with a definitive answer. I know my problem can\'t be that hard. Maybe it\'s just that I\'m tired..

Basically, I wa

6条回答
  •  日久生厌
    2020-12-02 10:54

    const int someheight = 3;
    const int somewidth = 5;
    
    int (*array)[somewidth] = new int[someheight][somewidth];
    

提交回复
热议问题