CString str;
str.Format(_T("%d"),num);
AfxMessageBox(str);CString str;
str.Format(_T("%d,%d"),pt1.x,pt1.y);
AfxMessageBox(str);上面第一段代码可以显示一个数值,第二段代码可以显示一个坐标
本文介绍如何使用MFC的CString与Format函数来显示一个整数和一个二维坐标点的值。通过简单的代码示例,展示了如何将整数和坐标点的x、y值格式化为字符串并用消息框显示。
CString str;
str.Format(_T("%d"),num);
AfxMessageBox(str);CString str;
str.Format(_T("%d,%d"),pt1.x,pt1.y);
AfxMessageBox(str);
被折叠的 条评论
为什么被折叠?
