void Log( const TCHAR *pszFormat, ... ) { TCHAR buf[1024] ; va_list arglist ; try { _tcscpy_s ( buf, 1023, _T("\n") ) ; va_start(arglist, pszFormat) ;
// Type xx = va_arg( ap, Type );
//依次获取指定参数,定义类型必须相同
_vstprintf_s(&buf[_tcslen(buf)], 1023-_tcslen(buf), pszFormat, arglist) ; va_end(arglist) ; _tprintf ( buf ) ; } catch ( ... ){} }
原文:http://www.cnblogs.com/iclk/p/3544675.html