Search:
Forum
Beginners
Error. Pow
[try Beta version]
Not logged in
register
log in
user name:
password:
remember me
forgot your password?
or sign in using:
try again
cancel
forgot your password?
Error. Pow
Apr 7, 2013 at 8:07pm
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
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
Apr 7, 2013 at 8:14pm UTC
Apr 7, 2013 at 8:22pm
Apr 7, 2013 at 8:22pm UTC
marco33
(3)
Thank you
Last edited on
Apr 7, 2013 at 8:39pm
Apr 7, 2013 at 8:39pm UTC
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs