this is my code
void SMatrix::pow(int power, SMatrix & result)
{
if (this->rowSize != this->colSize || this->rowSize != result.rowSize || this->colSize != result.colSize || power <= 0)
{
delete & result;
result = new SMatrix (result.rowSize, result.colSize);
}
}
Im trying to delete this result in this case, and send it as new SMatrix
. How can i do it? (reuslt = newM
..... ask me for SMatrix *
, but it doesn't work with &).
In the main i can build it like that: SMatrix * s = new SMatrix(4, 4); or SMatrix s(4, 4); (pointer or not).