Error. Pow

#include <iostream>
#include<math.h>
#include<stdio.h>
#include<conio.h>
using namespace std;
int main()
{
int a, b, c, i, d = 0, j = 1;
scanf("%d%d",&a,&b);
for(i = 0;a > abs(pow(b,i));i++)
{
if(d < pow(b,i))
{
d = pow(b,i);
j = i;
}
}
c = a - pow(b,j);
printf("%d",c);
getch();
}

ERROR: more than one instance of overloaded function "pow" matches the argument list:

What to do?
Explicitly to say the compiler which pow function you are going to use. The family of pow functions deal with floating numbers. So you should specify what floating type you will use as the type of arguments of the function.
Last edited on
Thank you
Last edited on
Topic archived. No new replies allowed.