I'm having trouble in compiling the following code. The compiler states:
Assigning to 'RawChunk::Ptr' (aka 'unsigned char (*)[128][16]') from incompatible type 'RawChunk::Chunk *' (aka 'unsigned char (*)[16][128][16]');
Does anyone know what I'm doing wrong? It seems like a simple mistake but I'm not sure what I'm supposed to change.
template <int dim>
class RawChunkWindow {
public:
typedef unsigned char (*Ptr)[ChunkDimensions::MAX_Y][ChunkDimensions::MAX_Z];
typedef unsigned char Chunk[ChunkDimensions::MAX_X][ChunkDimensions::MAX_Y][ChunkDimensions::MAX_Z];
RawChunkWindow() {
for (int i = 0; i < dim; ++i) {
for (int j = 0; j < dim; ++j) {
window[i][j] = &payload[i][j]; //compiler complains here
}
}
}
private:
Ptr window[dim][dim];
Chunk payload[dim][dim];
};