Hi, I am studying for my midterm exam. There is going to be a question about setting up an array dynamically, and maybe doing a copy constructor, a destructor and overloading the assignment operator. Can you please verify if I am correct. Also I don't understand what overloading the assignment operator means. Can you help me out with this?
class A
{
int* myArray; //basically I created a pointer called myArray,
A() //are my copy constructors correct? A(), and A(int size)?
{
myArray = 0;
}
A(int size)
{
myArray = new int[size];
}
~A() // I think my destructor is correct
{
delete [] myArray;
}
Can you check my code please? Also how do I overload assignment operator?
Thanks in advance.