I am trying to understand deep and shallow copy concept and then to apply it. My class is composed of :int* num, bool signe and int pos. The copy is not working well, does anyone know why?
CBigInt & operator= (const CBigInt & other)
{
if (this != &other)
{
int * new_array = new int[30000000];
std::copy(other.num, other.num+ other.pos+ other.signe, new_array);
delete [] num;
num = new_array;
pos = other.pos;
signe=other.signe;
}
return *this;
}