c++ 类型转换函数
2016-06-02 18:55
316 查看
string转int:
string转double:
以后遇到类型转化继续补充!
#include<cstdlib> string str; str = "123"; int num; num = atoi(str.c_str())
string转double:
#include<cstdlib> string str = "123"; double num = atof(str.c_str());
以后遇到类型转化继续补充!
相关文章推荐
- C语言-位域小问
- static const extern在C与C++中的区别
- 理解和使用zlib库 - 我个人的救赎
- c++调用python
- 关于C++中的继承和重载的区别
- c++指针
- C++ 变量命名约定和风格
- C++中#include <xxx.h>和#include "xxx.h"的区别(尖括号和双引号的区别)
- Struct和Class的区别
- C++中#include的工作原理
- C++11 | 运行时类型识别(RTTI)
- 李洪强-C语言5-函数
- c++学习课时二 简单的判断&&循环
- 第十三周【项目3-形状类族的中的纯虚函数】
- Eclipse运行C++问题Launch failed,Binary not found
- 详解Windows下Eclipse CDT 配置C-C++ 编译环境
- C++中ifstream使用笔记(二)(gdb调试案例BUG)
- 【C++】StreamString清空用法
- leetcode 160 Intersection of Two Linked Lists C++
- C++ STL--stack/queue 的使用方法