Reading hdf5 files to dynamic arrays in c++

谁都会走 提交于 2019-12-06 02:11:13

Your p2DArray must be a plain (1D) array of int, not an array of arrays. That's what a read method expects.

Just allocate enough space to store NX*NY numbers:

int *p2DArray = new int[NX*NY];

and then access the array using the following formula: p2DArray[i][j] = p2DArray[i*NY + j].

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!