答案 wprintf输出字符串 intwprintf(constwchar_t*format[,argument]...); eg:wprintf(L"Age=%d,Name=%s\n",10,"lily"); wsprintf填充一段缓冲区lpOut intwsprintf( LPTSTRlpOut,//outputbuffer LPCTSTRlpFmt,//format-controlstring ..
wprintf输出字符串 intwprintf(constwchar_t*format[,argument]...); eg:wprintf(L"Age=%d,Name=%s\n",10,"lily"); wsprintf填充一段缓冲区lpOut intwsprintf( LPTSTRlpOut,//outputbuffer LPCTSTRlpFmt,//format-controlstring ...//optionalarguments ); eg: TCHARtcBuffer[1024]={0}; wsprintf(tcBuff...
wprintf_s 和swprintf_s是unicode ,宽字符 CString应该不是宽字符的 你在工程属性里把“常规”-->“字符集”修改为多字节的 应该可以编译过
printf 能输出中文是因为你用的是中文系统,你的字符串由系统层面给你改了.区域->管理->非Unicode程序...
#include <cstdio> #include <cwchar> #include <string> int main() { std::string narrowstr = "narrow"; std::wstring widestr = L"wide"; printf("1 %s \n", narrowstr.c_str()); printf("2 %ls \n", widestr.c_str()); wprintf(L"3 %s \n", narrowstr.c_str()); wprintf(L"...
int wprintf_s(const wchar_t *format [,argument]...);int swprintf_s(wchar_t *buffer,size_t sizeOfBuffer,const wchar_t *format [,argument]...);swprintf_s的第一个参数是wchar_t *buffer
wprintf(L“Error: %s”, e.ErrorMessage());问题补充:匿名 2013-05-23 12:21:38 wprintf(L“的错误:%S”,e.ErrorMessage()); 匿名 2013-05-23 12:23:18 wprintf(l"错误:%s",E.errormessage()); 匿名 2013-05-23 12:24:58 正在翻译,请等待... 匿名 2013-05-23 12:26:38 ...