如果到处都用printf("%s:%s:%d, %s\n",__FILE__,__FUNCTION__, __LINE__,"hello")写起来也太麻烦了;而且有的时候还需要向内存缓冲区打印输出。...*/
debug_printf("hello %s","tom");
/** 内存缓冲区输出测试 */
char output[128];
int c = debug_snprintf(output...,sizeof(output),"welcom to my party %s","jerry");
printf("output size %d bytes, content:\n", c);
printf...("%s\n", output);
}
以上代码MSVC/GCC编译通过可以直接在命令行编译运行。...MSVC cl 编译器编译运行示例
MSVC cl 编译器编译
>cl _debug_printf.c
用于 x86 的 Microsoft (R) C/C++ 优化编译器 19.00.24215.1