Code:
A(....) {
dArray = new int [size];
}
What is the interface for this constructor?
Code:
int& operator=(const int& right) {
if (this != &right) {
A temp(right); swap(temp);
}
}
This copy assignment operator has a non-applicable interface. You need to read about the copy-swap idiom again, too. You're not doing it; swap has to exchange class data.
You also need to return *this because what if I do:
Code:
A foo, bar, quz;
...
foo = bar = quz;
Am I going in the right direction with this or am I making a bunch of dangling pointers and memory leaks? I'd appreciate some guidance if I am.
Almost certainly, but your major problem is the copy assignment operator.