Passing a 2D array to constructor, storing in private variable

I am struggling to store a 2D array of integers in a private variable after it has been passed to the constructor of class.

Header file:

class SomeClass {
	public:
		SomeClass(int myArray[][2], int myArraySize);

	private:
		int _myArray[][2];
		int _myArraySize;	
};

Class constructor in .cpp file:

SomeClass::SomeClass(int myArray[][2], int myArraySize) {
	int _stateMap[myArraySize][2] = myArray[myArraySize][2]; // various permutations of this don't work
}

I can pass the 2D array okay and direct references to myArray work correctly.

But all my attempts to assign the array to a private variable (_myArray) for future use either won't compile or outputs random numbers when accessed.

What am I doing wrong?

Try memcpy

What am I doing wrong?

What are you doing right would be easier to answer. Nothing.

You are creating a local variable in the constructor. That variable will go out of scope as soon as the constructor ends.

You have a private variable that is not sized correctly. You can't do that.

You are trying to assign a value to the first element beyond the bounds of the array that is coming from the first element beyond the bounds of the input array.

If you insist on a variable sized array, it MIST be allocated using malloc().

Is there a short code snippet that would fix this then?

There are lots of examples for 2D arrays in Arduino and C++ online but none that I can find in this context.

Is there a short code snippet that would fix this then?

No. You need to explain what you are trying to do.

You need to explain what you are trying to do.

I want to pass a 2D array to a new instance of a class via the constructor.

I then want to store this array in a private variable so the class can use it later on.

Does the class need a copy of the data? Can't you just pass it a pointer to the data that the sketch owns?