You probably just know how to return the pointer, if you can't return a higher dimension array.
The trick is to return an object. So define your 2D array as an object; you can use std::array<std::array<T, NCOLS>, NROWS>, or a vector equivalent or a struct/class. Then just return that.
If you stick with pointers, you'll loose dimension sizes.
if you know the dimensions (compile time constant 2d array?) you can return it as 1d and cast it back with some ugly tricks. But that is so very C and weird code.
There are a lot of reasons why 1d mapped to 2d is easier to work with (you manually index the 1d to make it '2d' exactly the same way C does it).
if you need to see the casting junk I can figure it out again, but its not a good idea.