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 }

 

posted @ 2016-06-29 21:48  C/C++/Python/Java  阅读(177)  评论(0)    收藏  举报