Having
class Foo {
public:
static constexpr size_t WIDTH = 10;
static constexpr size_t HEIGHT = 20;
private:
int _data[HEIGHT][WIDTH];
}
I would to get my variable _data from a member function of this class, but I cant find the good prototype.
see @How to return a static array pointer
but this syntax seems to dont work with member functions, it can't compile.
Also tried
int **getData() {
return static_cast<int **>(_data);
}
But I dont think this is a good pratice.