So, I am writing some code that should increase the value of the returned function to a certain power. I recently discovered that using the β^β operator to exponentiate is useless, because in C ++ it is actually an XOR operator or something like that. Now here is the code I want to write:
int answer = pow(base, raisingTo(power));
Now can someone tell me if this is correct? I will explain the code. I declared an int-variable answer, as you all know, and initialized it with the value of any variable called the "base" raised to the return value of the raiseTo () function acting on any other variable called "power". When I do this (and I edit and compile my code in Visual C ++ 2010 Express Edition), a red line appears under the word "pow", and an error appears: "more than one instance of the overloaded function" pow "corresponds to the argument list"
Can anyone solve this problem for me? And could you guys also explain to me how this whole pow () function works, because frankly the links to www.cplusplus.com are a bit confusing, since I'm still just a beginner!
source share