For some reason, the value of f is truncated. I get 26546.3 as output. I've tried changing the precision to no avail. Is there something I'm missing?
Code:string temp = "26546.298"; double result = 0.0; result = atof(temp.c_str()); cout << result << endl;