[try Beta version]
Not logged in

 
Error. Pow

Apr 7, 2013 at 8:07pm
#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?
Apr 7, 2013 at 8:11pm
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 Apr 7, 2013 at 8:14pm
Apr 7, 2013 at 8:22pm
Thank you
Last edited on Apr 7, 2013 at 8:39pm
Topic archived. No new replies allowed.