博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
笔记,将CString转换为数值
阅读量:7185 次
发布时间:2019-06-29

本文共 581 字,大约阅读时间需要 1 分钟。

         ANSI  UNICODE  TCHAR

int     atoi     _wtoi     _ttoi

long       atol     _wtol     _ttol

double   atof     _wtof    _ttof

示例

#include 
#include
int main(){ using namespace std; CString oneHundred("100"); int i = _ttoi(oneHundred); cout << "i: " << i << endl; CString oneThousand("1000"); long l = _ttol(oneThousand); cout << "l: " << l << endl; CString doubleString("3.14159"); double d = _ttof(doubleString); cout << "d: " << d << endl; system("pause"); return 0;}

参考链接:

转载于:https://www.cnblogs.com/buyishi/p/10410164.html

你可能感兴趣的文章
JSoup简单测试
查看>>
svn 一、 安装及汉化
查看>>
linux CentOS7 安装字体库-转
查看>>
JAVA-JSP内置对象之request范围
查看>>
tornado+websocket+mongodb实现在线视屏文字聊天
查看>>
Vue组件通讯
查看>>
9月7日学习内容整理:内置函数
查看>>
尚硅谷面试第一季-13git分支相关命令
查看>>
Android IndicatorSeekBar
查看>>
一种局部二值化算法:Sauvola算法
查看>>
hdoj 1231 最大连续子列和
查看>>
入职五年回顾(四) 2012年11月
查看>>
webpack学习(二)
查看>>
最简单的菜单操作
查看>>
简单介绍java Enumeration
查看>>
CODEVS_1074 食物链
查看>>
springmvc webservlet 异步请求总结
查看>>
安装 QC 10.0
查看>>
JAVA高精度4_递推求值
查看>>
新手Android开发:onclicklistener到底怎么用?
查看>>