#include <windows.h> #include <tchar.h> //变参函数 bool _trace(TCHAR *format, ...) { TCHAR buffer[1000]; va_list argptr; va_start(argptr, format); //将格式化信息写入指定的缓冲区 wvsprintf(buffer, format, argptr); va_end(argptr); //将缓冲区信息输出 OutputDebugString(buffer); return true; } int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow ) { _trace(_T("今天有%d个"), 123); }