I made this constructor, and I need to make a deep copy of it. I don't really understand the meaning of a deep copy. I know it makes independent copy of an object that has its own dynamic memory, but I don't understand what the need is for this. I'm also not sure how to actually implement the deep copy. Any suggestions?
Here is my constructor that I need to make deep copy of: Could anyone provide some syntax help, like a skeleton?
template<class t_type>
inline ALIST<t_type>::ALIST()
{
t_type value;
capacity=10;
DB = new t_type[capacity];
count=capacity;
cout<<"Enter value: ";
cin.clear();
cin>>value;
for(int i=0; i<capacity; i++)
{
DB[i]=value;
}
}