c++中的Format()是一个什么函数?

来源:百度知道 编辑:UC知道 时间:2024/06/05 08:38:58
在c++中看到一个陌生的Format(),这是一个函数吗? 函数原型是什么,求大侠帮忙

C++应该没有这个函数的,你说的Format是在MFC程序里看到的吧
Format是CString字符串类的成员函数
CString::Format( LPCTSTR lpszFormat, ... );

用法很简单,就和C语言里的printf函数一个样
比如:
int count=3;
CString str;
str.Format("Count is %d",count);
这样str就变成:Count is 3

格式化函数,把数字转换成字符串,MFC中经常用到