I have to implement a polynomial class in which you can overload addition, subtraction, and multiplication. I believe that I have the constructors and the destructor set up correctly. I can't figure out how to pull the array from the heap in order to perform the necessary operations. Any help would be appreciated.
You have a coefArray member in your class which you can iterate over with a loop, which you've already demonstrated you can do. your operators are declared as friend functions which means they also have access to coefArray for your arguments.
1 2 3
Polynomial polySum(0, deg);
for (int i = 0; i < deg; ++i)
polySum.coefArray[i] = poly1.coefArray[i] + poly2.coefArray[i];