示例1:初始化一个数组: template <class T> void InitArray(T *dstArray, int c, ...) { va_list arg; va_start(arg, c); for (int i = 0; i < c; i++) { dstArray[i] = va_arg(arg, T); } va_end(arg); } 示例2:效仿printf等支持格式化字符串操作: void DoSomethingElseWithString(LPCTSTR szFormat, ...) { va_list v; va_start(v, szFormat); static const int c_sMaxBuf = 1024; TCHAR szBuffer[c_sMaxBuf]; ZeroMemory(szBuffer, c_sMaxBuf * sizeof(TCHAR)); int nBuf = _vsntprintf_s(szBuffer, c_sMaxBuf, szFormat, v); if (nBuf < c_sMaxBuf) { DoSomethingElse(szBuffer); } va_end(v); }