VS2005 C++ str.Format 编译错误

 str.Format("5+3=%d",add(5,3));

error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [7]' to 'const wchar_t *' c:/documents and settings/iamoyjj/my documents/visual studio 2005

改为,加L即可

str.Format(L"5+3=%d",add(5,3));

原文地址:https://www.cnblogs.com/oyjj/p/2133029.html