首页 > 其他 > 详细

CString转int

时间:2020-01-10 11:53:05      阅读:52      评论:0      收藏:0      [点我收藏+]

int转CString就不细说了,使用format即可,

这里简单介绍下CString转int的一种简便方法

 1 CString strNum("100");
 2 
 3 int num;
 4  
 5 //ANSI
 6 
 7 num = atoi(strNum); 
 8 num = _ttoi(strNum);
 9 
10   
11 //UNICODE 
12 num = atoi(CT2A(strNum.Getbuff())); 
13 num = _ttoi(strNum);

总结:

使用 _ttoi 可以适用于 ANSI和UNICODE两种版本。

 

转自:

https://blog.csdn.net/myruo/article/details/81505405

CString转int

原文:https://www.cnblogs.com/luoluosha/p/12174960.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!