⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 atof.cpp

📁 数据结构常用算法合集
💻 CPP
字号:
//atof.cpp
#include <stdlib.h>
#include <iostream.h>
#include <conio.h>
void main(void)
{
  float f;
  int integer;
  char *str = "12345.67";
  f = atof(str);
  cout<<"字符串"<<str<<"转换为"<<f<<"的数值\n";
  integer = atoi(str);
  cout<<"字符串"<<str<<"转换为"<<integer<<"的整数值\n";
  char *st="1.2E+13";
  f = atof(st);
  cout<<"字符串"<<st<<"转换为"<<f<<"的数值\n";
  char *ss="12.S11";
  f = atof(ss);
  cout<<"字符串"<<ss<<"转换为"<<f<<"的数值";
  getch();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -