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 288 views
1 answer 243 views
243 views asked Jun 20, 2021 by avibootz
2 answers 390 views
390 views asked Aug 7, 2019 by avibootz
1 answer 180 views
180 views asked Jun 28, 2024 by avibootz
1 answer 400 views
1 answer 264 views
...