#include <iostream>
#include <cmath>
using namespace std;

float scale (float,int) ;
int main()
{
    float num1;
    int num2 ;
    cout << "Enter a real number : " ;
    cin >> num1;
    cout << " Enter an integer: " ;
    cin >> num2;
    cout << " Result of call to function scale is "
    << scale (num1,num2)
    << endl;
    return 0;
}
float scale ( float x, int n)
{
      float scaleFactor;
      scaleFactor = pow(10, n );
      return (x * scaleFactor);
}

the problem is : " 22 C:\Documents and Settings\QuynhlNguyen\My Documents\Final\scale.cpp call of overloaded `pow(int, int&)' is ambiguous "

#include <iostream>
#include <cmath>
using namespace std;

float scale (float,int) ;
int main()
{
    float num1;
    int num2 ;
    cout << "Enter a real number : " ;
    cin >> num1;
    cout << " Enter an integer: " ;
    cin >> num2;
    cout << " Result of call to function scale is "
    << scale (num1,num2)
    << endl;
    return 0;
}
float scale ( float x, int n)
{
      float scaleFactor;
      scaleFactor = pow(10, n );
      return (x * scaleFactor);
}

the problem is : " 22 C:\Documents and Settings\QuynhlNguyen\My Documents\Final\scale.cpp call of overloaded `pow(int, int&)' is ambiguous "

There is no pow (int, int). Try making it pow (10.0, n) instead of pow (10, n)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.