atof的作用是将字符数组转换成相应的双精度的实数,

本题的例子如下:

(仅供参考)

#include<iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;
int main()
{
 char a[10]="1236241";
 double b=atof(a);
 cout<<b<<endl;
 return 0;
}

相关文章:

  • 2021-12-18
  • 2021-08-09
  • 2022-02-12
  • 2022-02-27
  • 2021-12-19
  • 2022-02-28
  • 2022-12-23
猜你喜欢
  • 2021-06-18
  • 2021-09-26
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2021-09-03
  • 2021-12-04
相关资源
相似解决方案