I am new to C++ and havn't used C in quite a while. I am trying to complie the code listed below. When I compile the code I get a compiler error that says "C2666: 7 overloads have similar conversions" I am using MS Visual C++.NET. If I click on the error it takes me to the pow() function in the do loop. I have tried including math.h and complex.h but neither helped. Can anyone tell me what is wrong here?
Thanks
Scott
#include <iostream>
#include <cmath>
#include <complex>
#include <iomanip>
using namespace std;
void main()
{
double conversion_factor=0.00194032;
double mult_factor=0.2222222;
double rho=1.225;
double converted_rho=0;
cout<<"rho kg/m^3"<<"\t"<<"rho slug/ft^3"<<endl;
cout<<"----------"<<"\t"<<"-------------"<<endl;
do
{
double i=0;
converted_rho=rho*conversion_factor;
cout<<setprecision(4)<<rho<<"\t\t"<<converted_rho<<endl;
i+=mult_factor;
complex <double> lognum=pow(10,-i);
rho*=lognum;
}while (rho>=0.01225);
}
Thanks
Scott
#include <iostream>
#include <cmath>
#include <complex>
#include <iomanip>
using namespace std;
void main()
{
double conversion_factor=0.00194032;
double mult_factor=0.2222222;
double rho=1.225;
double converted_rho=0;
cout<<"rho kg/m^3"<<"\t"<<"rho slug/ft^3"<<endl;
cout<<"----------"<<"\t"<<"-------------"<<endl;
do
{
double i=0;
converted_rho=rho*conversion_factor;
cout<<setprecision(4)<<rho<<"\t\t"<<converted_rho<<endl;
i+=mult_factor;
complex <double> lognum=pow(10,-i);
rho*=lognum;
}while (rho>=0.01225);
}