You have correctly defined 2 overloaded constructors and a destructor.
However, you haven't defined an explicit copy constructor properly.
Normally the compiler will generate one for you, and this is called an implicit copy constructor.
The problem with the auto-generated implicit copy constructor in your particular case is that it will only perform a shallow copy of myArray, where it shares the same pointer value but hasn't allocated its own section of memory for myArray.
This means if you delete myArray in the original object, it will affect the copy which is most likely not what you want.
Defining an explicit copy constructor like this will help:
A(const A& copy)
: _size(copy.size), myArray(new int[copy.size])
{
// #include <algorithm> for std::copy
std::copy(copy.data, copy.data + copy.size, data);
}
(Source: Copied from Wikipedia)
If you define the copy constructor like this, you should not need to overload the assignment operator. If you create a new object, and assign it to the first object you created, you will successfully create an independent copy of the first object.
Edit: From this article:
The copy assignment operator differs
from the copy constructor in that it
must clean up the data members of the
assignment's target (and correctly
handle self-assignment) whereas the
copy constructor assigns values to
uninitialized data members.