CString str; int number=15; //str="15" str.Format(_T("%d"),number); 其中,_T

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/11 14:22:06
CString str; int number=15; //str=
xQ=O@+M46 L|88A\ Q(* A% Rywaty "Q]˨gBQׂBFK?a9r Ľ(ɮR jljJ!?>7]btKa8ϻunogS.

CString str; int number=15; //str="15" str.Format(_T("%d"),number); 其中,_T
CString str; int number=15; //str="15" str.Format(_T("%d"),number); 其中,_T

CString str; int number=15; //str="15" str.Format(_T("%d"),number); 其中,_T
在VS中编码默认为多字节.
但是,如何使用unicode呢?
如何在改变编码方式的时候尽量不改动原来的代码呢?
_T()的作用就体现了,你把设置中的编码改成什么,它的结果就是什么.
比如改成unicode,那么_T("hello")等价于L"hello".
改成多字节,那么_T("hello")等价于"hello".