C++ 之独立编译打印输出

来源:互联网 发布:网络做饭卖用啥软件 编辑:程序博客网 时间:2024/06/11 23:39
#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;
}
原创粉丝点击