When calling ans+= c[i] * pow(x,i);, xCode is complaining “Too many arguements to function call, expected 1 have 2”. I have a locally defined function as follows:
Polynomial pow(unsigned int n) const;
and a constructor:
Polynomial(const double t = 0.0);
How can I specify that I would like to use cmath’s pow function and not the locally defined one?
Thanks for the help!
Well, assuming you’re keeping all your own stuff out of the
stdnamespace (and, if you’re not, you should be, since that was the entire raison d’être of namespaces), you can just usestd::pow().See the following code for an example: