Simple 3D Array C++

后端 未结 5 1600
深忆病人
深忆病人 2021-02-05 13:57

I am a novice in C++ and I am trying to create a simple static 3 Dimensional Array and then print it out in console.

Here is my current code:

#include &l         


        
5条回答
  •  猫巷女王i
    2021-02-05 14:26

    you array MyArray[MAX_ROW][MAX_COL][MAX_HEIGHT] only can hold 2*2*2=8 elements, but

    { {1,1},
                               {2,10},
                               {3,15},
                               {4,20},
                               {5,25},
                               {6,30},
                               {7,35},
                               {8,40} };
    

    has 16 elements. so there are too many initializers

提交回复
热议问题