I created a class called Polynomial that asks the user for coefficients and exponent. I also created a function that would add the two polynomials.
I'm stuck on how to access my pointer arrays from an instance and different objects.
I dont understand why i get an error at temp.*(p+i) and op.*(p + i) "expression must have a pointer-to-member type". Please help!
1 2 3 4 5 6 7 8 9
Polynomial Polynomial::operator+(Polynomial op)
{
Polynomial temp;
for(int i = 0; i < SIZE; i++)
{
temp.*(p+i) = *(p + i) + op.*(p + i); //stuck here
}
return temp;
}
If additional code is needed, I would be happy to provide them.