Hi,
I am trying to use pow function in my program and get the complier error saying: "ambiguous call to overloaded function". Can't figure out what I did wrong.
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main ()
{
int x, y;
double p, q, r;
cout << "Enter a numeric value for x :" << endl;
cin >> x;
cout << "Enter a numeric value for y :" << endl;
cin >> y;
It's the "pow(2,n)" part. It means that there are other versions of the function that take different arguments or different numbers of arguments, and you haven't provided enough information for it to figure out which one you wanted.
EX:
1 2 3 4 5 6
pow(int a, int b, int c = 0);
//and
pow(int a, int b, char c = "", int d = 0);
//defined...wherever
pow(x,y); //<-- would return ambigous call because compiler can't tell which function you want