I am trying to overload =operator and here is my function
CODE
const Array &Array::operator=( const Array &right)
{
if( &right != this)
{
delete [] ptr;
size = row*column;
ptr = new int[ size];
}
for( int i = 0; i <size; i++)
{
ptr[i] = right.ptr[i];
}
is this what u do for 2d array? I am trying to use this function for 2d array.....
row, column and size are my private variables.
Thanks,