cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Error. Pow
Error. Pow
Apr 7, 2013 at 8:07pm UTC
marco33
(3)
#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 UTC
vlad from moscow
(6539)
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 UTC
Apr 7, 2013 at 8:22pm UTC
marco33
(3)
Thank you
Last edited on
Apr 7, 2013 at 8:39pm UTC
Topic archived. No new replies allowed.