nothing

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
matrix matrix::clone()
{
    // create a new matrix object with the correct dimensions
    matrix cloned_matrix(rows,columns);

    // copy the content
    /* ... */

    // return the copy
    return cloned_matrix;
}


By the way, why are you allocating size pointers ?
You should either allocate size doubles or rows pointers.
Last edited on
Hey, sorry I asked someone else and they gave me the answer. I don't know how to delete the post though :s
you don't delete the post, you mark it as solved --->top left (With the original post still there!)
Don't delete your post after getting an answer.
My bad. I don't have the post anymore. Didn't think it would be much help to anyone else because of how bad I messed it up.

If anyone wants to see what I was talking about I have another question to ask. I'll link the correction here:

http://www.cplusplus.com/forum/general/93046/


Also, thank you toum for the help. I was just trying random things to fix it by the time I posted this, so I'm glad you were able to understand what I was trying to do.
Topic archived. No new replies allowed.