How to convert char array to double in C++

1 Answer

0 votes
#include <iostream>

int main() {
    char arr[] = "89.012";

    double d = atof(arr);
    
    std::cout << d;
}



  
/*
run:
  
89.012
  
*/

 



answered Jun 20, 2021 by avibootz

Related questions

1 answer 178 views
1 answer 153 views
153 views asked Jun 20, 2021 by avibootz
2 answers 269 views
269 views asked Aug 7, 2019 by avibootz
1 answer 87 views
1 answer 282 views
1 answer 164 views
...