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 244 views
244 views asked Jun 20, 2021 by avibootz
2 answers 391 views
391 views asked Aug 7, 2019 by avibootz
1 answer 181 views
181 views asked Jun 28, 2024 by avibootz
1 answer 401 views
1 answer 265 views
...