And would you please tell me how to use the return statements for returning Matrices
Stop using arrays and switch to vectors (or a matrix class), that's how you do it:
vector<vector<int>> func();
There are some things that array types simply aren't suited for, and this is one of them.