CString
offers a method Format
for formatting printf
-style, but it is not type safe.
For string formatting of strings, you can either use std::stringstream
/ std::wstringstream
or 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() );
, !