65,210
社区成员
发帖
与我相关
我的任务
分享#include <iostream>
#include <string>
#include <boost/format.hpp>
using namespace std;
int main(int argc, char* argv[])
{
cout << boost::format( "%1% %2%" ) % "Hell" % "Low" << endl;
string s1 = boost::str( boost::format( "%2% %1%" ) % "Hell" % "Low" );
cout << s1 << endl;
wcout << boost::wformat( L"%s %X" ) % L"-1 is" % -1 << endl;
wstring s2 = boost::str( boost::wformat( L"%2$s %1$.2f" ) % 3.141592 % L"Version" );
wcout << s2 << endl;
return 0;
}