Answers for "str vers float c++"

C++
1

c++ std string to float

std::string num = "0.6";
double temp = ::atof(num.c_str());

std::cout << temp << std::endl;
// Output: 0.6
Posted by: Guest on February-27-2021
1

float in c++

float contains less storage than a double. 
float p = 25.0;
double p = 25.0;
Posted by: Guest on July-06-2020

Browse Popular Code Answers by Language