^The problem here is that set_a is a local variable, a copy of whatever you passed in as a parameter. This set_a is not part of your class, so changing this has no meaning whatsoever. And assigning tmp to it is even more meaningless, since it seems to have nothing to do with the function whatsoever.
The correct function (assuming you're trying to change a) is
1 2 3
void Polynomial::setA(double set_a){
a = set_a;
}
EDIT: I need to remember to refresh threads before submitting posts...
thanks again! sorry one last thing maybe you could figure out? I'm getting an error: too few arguments in function call and findRoots function does not take two arguments. the error is here it's the last one im getting
1 2 3 4 5 6 7 8
if (p.findRoots(r1, r2)) {
cout << "\twith roots at " << r1 << " and " << r2 << endl;
}
else {
cout << "\tNo Roots" << endl;
}
and i tried fixing it by adding a, b, c to the parameters but then I get more errors than before