Advertisement
AbraaoAllysson

string to double

Apr 26th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstring>
  4. #include <cstdlib>
  5.  
  6.  
  7.  
  8. int main() {
  9. std::string num = "0.6666666";
  10. double temp = atof(num.c_str());
  11.  
  12. std::cout << num << " " << temp << std::endl;
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement