C++ - 不定参数
1 #include <stdio.h> 2 #include <stdarg.h> 3 4 // 打印调试信息 5 void DbgPrintf(char *pszFormat, ...) 6 { 7 char szFormat[0x400]; 8 memset(szFormat, 0, sizeof(szFormat)); 9 va_list argList; 10 va_start(argList, pszFormat); 11 vsprintf_s(szFormat, sizeof(szFormat), pszFormat, argList); 12 OutputDebugStringA(szFormat); 13 va_end(argList); 14 }

浙公网安备 33010602011771号