-1
以下函數在控制檯上打印垃圾。無法理解問題。以下是測試代碼片段。變量參數列表打印垃圾
void
format(
const char* pcszFormat,
...
)
{
va_list VarArglist;
va_start(VarArglist, pcszFormat);
printf(pcszFormat, VarArglist);
va_end(VarArglist);
}
int wmain(int argc, wchar_t *argv[])
{
string strTest;
const char *pcszFormatted;
format("%x %S", 10, "Test");
//printf("\nFormatted string: %s", pcszFormatted);
getchar();
return 0;
}
請縮進你的代碼! – 2501