Format錯誤

 

問題:

我用Format時,它總提示我錯誤
void __cdecl CString::Format(const unsigned short *,...)' : cannot convert parameter 1 from 'char [3]' to 'const unsigned short *'

 

回答:

CString str;
int n;
n=10;
str.Format(_T("%d"),n);
在Unicode中,所有的""都必須用_T("")來替換,否則會有
不可預料的後果。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章