MFC格式化字符串

可以使用Format函数,示例如下,和printf格式化输出类似

int n = 10
CString str;
str.Format(_T("n=%d"),n);
MessageBox(str);

其中_T可以换成Text,在这里的作用是自适应编码(多字节和宽字节),具体可以看Windows字符集

猜你喜欢

转载自blog.csdn.net/weixin_50497501/article/details/128285375
今日推荐