return * newarray; doesn't mean anything in C++.
Your assignment is to return a matrix, so you should return a matrix.
It's easy: begin by creating a second matrix, then copy the content, and finally return it.
1 2 3 4 5 6 7 8 9 10 11
// create a new matrix object with the correct dimensions
// copy the content
/* ... */
// return the copy
By the way, why are you allocating size pointers ?
You should either allocate size doubles or rows pointers.