Reputation: 9049
I have a template class in C++ that looks like this:
template <typename T, int xMax, int yMax, int zMax>
class Volume {
public:
T*[64][64] getDataPointer() {return data;} //compiler doesn't like this line
private:
T data[xMax][yMax][zMax];
};
typedef Volume<unsigned char, 64, 64, 64> Chunk;
The compiler doesn't like the return I have for getDataPointer(). I want to return the same type I would then use to pass to this function:
void perlin2D(unsigned char (*chunk)[64][64])
Can someone show me how to do that?
Upvotes: 2
Views: 155
Reputation: 380
T*** getDataPointer() {return data;} maybe you need something like this?
Upvotes: -1
Reputation: 5322
Change the signature to :
T (*getDataPointer())[64][64] {return data;}
Upvotes: 8