Matrix33::Matrix33(int* array) // 얕은 복사
{
this->array = new int(sizeof(array) * 9);
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
*(this->array + 3 * i + j) = *(array + 3 * i + j);
}
}cout << endl;
}
Matrix33::Matrix33(Matrix33& matrix33) // 깊은 복사
{
this->array = new int(sizeof(matrix33.array)*9);
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
*(this->array + 3 * i + j) = *(matrix33.array + 3 * i + j);
}
}cout << endl;
}
Matrix33 class에 있는 array 포인터변수로 3x3배열 복사하는건데
깊은 복사가 안되고 계속 오류난다 어찌해야하냐.... 도움 부탁한다. 저기서 뭐가잘못된거같음???
댓글 0