Make your function support multi args (paras).
来源:互联网 发布:js数组元素赋值 编辑:程序博客网 时间:2024/05/17 21:50
void Reporter::record(unsigned int outType, RPT_MSGTYPE messageType, const char* format, ...)
{
va_list args;
// retrieve the variable arguments
va_start( args, format );
int len;
#ifdef _MSC_VER
int tem = _vscprintf( format, args );
len = _vscprintf( format, args ) // _vscprintf doesn't count
+ 1; // terminating '/0'
#else
char tmp[16];
len = vsnprintf(tmp, sizeof(tmp)-1, format, args) + 4;
#endif
char buffer[1024] = "";
vsprintf( buffer, format, args ); // C4996
va_end(args);
//must to construct a string type with the char* at here,
//else it will call the record(,,const char* format, ...)
//and will cause an calling circle
record(outType, messageType, string(buffer));
//free(buffer);
}
- Make your function support multi args (paras).
- Make Your Mark with Multi-level Marketing
- Make Vim as Your Bash-IDE Using bash-support Plugin
- How to make your app support Galaxy note
- Make your .Net application support scripting - a practical approach
- Make Vim as Your Perl IDE Using perl-support.vim Plugin
- Multi-resolution support
- Multi-Window Support
- Qt multi screen Support
- multi-window support
- 28.Multi-process Support
- Your ID is under ID protection. Your current version does not support this function. Please download the latest Simplified Chine
- GDB debug function with args
- make though multi core
- “API design is like sex: Make one mistake and support it for the rest of your life.”
- make your mark
- Make your responsibilities clear
- Make your choice.
- TD8.0移植到QC9.2
- J2SE综合--JAVA实现把汉字转化成拼音
- 24 个漂亮的个性化 HTML 表单技术
- 开发人员如何谈加薪,抛砖引玉
- 【转载】windows下进程间通信方式
- Make your function support multi args (paras).
- J2SE API读取Properties文件的六种方法
- UTF-8到acsii的转换(让自己的C++程序支持多语言)
- 数据库相关:实现不同数据库之间的迁移
- float/real轉換為字符誤區
- 并发与竞态
- Java基础——孙鑫谈Java中文乱码问题产生原因分析
- Java Swing的基础知识全接触
- 设计模式--JDBMonitor的基本原理探究