I have a float array. Since i deal with big data > 10 GB i want to allocate some space But how do i write and read into this data ? I have to say, i'm a matlab coder, and have no idea how to do this in c++.
// allocating space
float *buffnew = new float[size_x*size_y*size_z];
// write
**buffnew[x][y][z] = 1.1f;
// read
prediction = **buffnew[x][y][z];
This does not work.The error i get is:
error: subscripted value is not an array, pointer, or vector
edit : I just see my error. I used an 1D array to allocate ( on the heap, because of the big data ) and then used a 3D to access it.
std::array<std::array<std::array<float ,size_z>, size_y>, size_x>