C++ 之独立编译打印输出
2017-06-13 18:29
260 查看
#include "stdafx.h"
#include <windows.h>
#include <cstring>
#include <stdarg.h>
void DbgPrintf_Mine(char *pszFormat, ...){
#ifdef _DEBUG
char szbufFormat[0x1000];
char szBufFormat_Game[0x1008] = "QGLog";
va_list argList;
va_start(argList, pszFormat);
vsprintf(szbufFormat, pszFormat, argList);
strcat(szBufFormat_Game, szbufFormat);
OutputDebugStringA(szBufFormat_Game);
va_end(argList);
#endif
}
int main(int argc, char* argv[])
{
printf("Hello World!\n");
DbgPrintf_Mine("%d,%d,%d", 1, 3, 5);
return 0;
}
#include <windows.h>
#include <cstring>
#include <stdarg.h>
void DbgPrintf_Mine(char *pszFormat, ...){
#ifdef _DEBUG
char szbufFormat[0x1000];
char szBufFormat_Game[0x1008] = "QGLog";
va_list argList;
va_start(argList, pszFormat);
vsprintf(szbufFormat, pszFormat, argList);
strcat(szBufFormat_Game, szbufFormat);
OutputDebugStringA(szBufFormat_Game);
va_end(argList);
#endif
}
int main(int argc, char* argv[])
{
printf("Hello World!\n");
DbgPrintf_Mine("%d,%d,%d", 1, 3, 5);
return 0;
}
相关文章推荐
- 学习C++独立编译
- 用mingw编译C++工程;程序里面的cout<<"aaa";cmd运行c++程序,aaa内容在控制台不显示,如何将aaa输出到控制台屏幕并将控制台内容写到一个文件中。
- DPDK编译到独立C++工程的一个方法
- 用C++编一程序,先输出一行sun mon tue wed thu fri fri,接着使用右对齐打印出日期,像日历那样
- c和C++的调试打印输出方法
- C/C++如何打印输出二进制串
- Ubuntu下安装配置NDK、独立交叉编译工具编译C/C++程序
- c c++ 函数入口和出口的hook(gcc 编译选项),然后打印出函数调用关系的方法
- C++ 打印输出指针
- C++ 打印输出日志文件
- C++ 用条件编译 控制开发过程中输出调试信息
- Makefile 编译时如何输出打印信息
- C++例题1:输出可打印字符
- C++ 打印输出LPCTSTR 输出中文
- C++中将打印结果输出到文件中
- 【编译原理】使用Lex将C/C++文件输出为HTML文件
- C++ 读取PE文件并十六进制打印输出
- C++ 打印文件名, 行号,编译日期和时间例子
- 【C/C++】sizeof之打印输出数组元素
- C++打印当前的行号,文件名,编译时间,编译日期