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 190 views
1 answer 168 views
168 views asked Jun 20, 2021 by avibootz
2 answers 282 views
282 views asked Aug 7, 2019 by avibootz
1 answer 97 views
1 answer 306 views
1 answer 172 views
...