大家好,又见面了,我是你们的朋友全栈君。
int转CString就不细说了,使用format即可,
这里简单介绍下CString转int的一种简便方法
CString strNum("100");
int num;
//ANSI
num = atoi(strNum);
num = _ttoi(strNum);
//UNICODE
num = atoi(CT2A(strNum.Getbuff()));
num = _ttoi(strNum);
总结:
使用 _ttoi 可以适用于 ANSI和UNICODE两种版本。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/124759.html原文链接:https://javaforall.cn