美文网首页MFC
mfc CString 和 int 的互相转换

mfc CString 和 int 的互相转换

作者: 云胡同学 | 来源:发表于2019-08-23 16:14 被阅读0次
int CStringReverseInt(CString strNumber, int number)
{
  number= atoi(strNumber);   // ANSI
  number= _ttoi(strNumber);  // ANSI
  number= atoi(CT2A(strNumber.Getbuff())); //UNICODE
  return number;
}

CString IntReverseCString(CString strNumber, int number)
{
    strNumber.Format(_T("%d"), number);
    return strNumber;
}

相关文章

网友评论

    本文标题:mfc CString 和 int 的互相转换

    本文链接:https://www.haomeiwen.com/subject/sastectx.html