Doesnt the Visual Studio 2008 compiler autocast to double with sqrt in C++?
- by Chris_45
Shouldn't the compiler automatically cast to a double in this case at least according to Walter Savitch:
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int k;
for(k = 1; k <= 10; k++)
cout << "The square root of i is: " << sqrt(k) << endl;
return 0;
}//error C2668: 'sqrt' : ambiguous call to overloaded function
//Visual Studio 2008 on Win Vista