CStringoffers a method Formatfor formatting printf-style, but it is not type safe.
For string formatting of strings, you can either use std::stringstream/ std::wstringstreamor Boost Format , although they both work with a C ++ class template std::basic_string, not an MFC class CString. I have successfully used both of them in VC6.
Boost , printf -like , , , , ++ iostreams .
, CString std::string :
std::string s;
CString str( s.c_str() );
, !