In my main function I'm creating an array:
char arr[0x10000][9];
In another class B
I would like to have a pointer to this array:
typedef char memory[0x10000][9];
class B{
public:
B(memory* mem);
private:
memory* _mem;
}
and the implementation
B::B(memory* mem){
this->_mem = mem;
}
And the main function:
....
char arr[0x10000][9];
arr[0][0] = 7;
arr[0][1] = 7;
// and so on...
B* b = new B(&arr, true);
...
Unfortunately, I can only access _mem[0][0]
correctly, if I access _mem[0][1]
, then I'm getting some random value, but not the one that I set in the main method.