Before we sort out the making of the new array - we need to sort these two lines out.
1 2
fil=fil;
col=col;
They are legal - BUT the problem is that the function has parameters called fil and col
and the matriz class also has members called fil and col.
So which fil and col are we talking about in those two lines.
In fact we will be talking about the function parameters - so you are setting the function parameters to themselves! - NOT setting the memebr variables to the value of the function parameters.
Change either the names of the member vriables or the names of the function parameters to
avoid this problem.
Then again, how can I solve my main problem ? I NEED to implement that representation, but I don't really understand how to.
How can I make an array of pointers that within each element points to another array created dynamically?
Shouldn't the private part have a pointer to a pointer and a pointer? And I need that the pointer to a pointer points to an array of pointer that will point to another array with a row of the matrix.
But I just can't think it in my head how to do this.
I didn't allocate the new memory as pointer again, so that's why it wouldn't work for me, since the variable filaspointer was a pointer to a pointer, it would give me an error.