buzzbuzz, i tried what you said to do, and i am getting some other errors now.
Code:
#include <iostream>
#include <cmath>
using namespace std;
int num;
double mySquareRoot(int)
{
return sqrt(num);
}
int main()
{
do
{
cout << "Enter a number (a double): ";
cin >> num;
cout << "The square root is " << mySquareRoot(num);
} while (num != 0);
}
and the errors are now:
Code:
1>c:\documents and settings\bruce\my documents\visual studio 2008\projects\ass25\ass25\ass25.cpp(9) : error C2668: 'sqrt' : ambiguous call to overloaded function
1> c:\program files\microsoft visual studio 9.0\vc\include\math.h(581): could be 'long double sqrt(long double)'
1> c:\program files\microsoft visual studio 9.0\vc\include\math.h(533): or 'float sqrt(float)'
1> c:\program files\microsoft visual studio 9.0\vc\include\math.h(128): or 'double sqrt(double)'
1> while trying to match the argument list '(int)'
this is the error that i have typically been getting for the duration of trying to do this.