MFC在使用unicode情况下怎样把int转为wchar_t*?

解决方案 »

  1.   

    CString s;
    s.Format(_T("The total is %d"), total);
      用这种方法的好处是你不用担心用来存放格式化后数据的缓冲区是否足够大,这些工作由CString类替你完成。
      格式化是一种把其它不是字符串类型的数据转化为CString类型的最常用技巧,比如,把一个整数转化成CString类型,可用如下方法:CString s;
    s.Format(_T("%d"), total);
     
      

  2.   

    wchar_t * _itow(
       int value,
       wchar_t *str,
       int radix 
    );errno_t _itow_s(
       int value,
       wchar_t *buffer,
       size_t sizeInCharacters,
       int radix 
    );MSDN有详细解说