Handling Huge Multidimensional Arrays in C++

前端 未结 8 2002
别那么骄傲
别那么骄傲 2021-01-24 19:15

I\'m designing a game in C++ similar to Minecraft that holds an enormous amount of terrain data in memory. In general, I want to store an array in memory that is [5][4][5][50][

8条回答
  •  攒了一身酷
    2021-01-24 20:00

    If you want the class created on the heap, create it with new:

    Child * c = new Child;
    

    and then of course delete it, or better still use a smart pointer.

提交回复
热议问题