您的位置:首页 > 编程语言 > PHP开发

OutputDebugString小例子

2012-09-13 14:12 253 查看
不常使用OutputDebugString,记录分享下。

//==============================================================================

#include <windows.h>

#include <stdio.h>

int main(int argc, char** argv)

{

    LPCWSTR strShow = L"OutputDebugString sample 1\n\tOutputDebugString sample 2\n";

    OutputDebugString(strShow);

    wchar_t buf[100];

    int bye = 88;

    int len = swprintf(buf, 100, L"%s and %d\n", L"Hello world", bye);

    printf( "wrote %d characters\n", len );

    OutputDebugString(buf);

    getchar();

    return 0;

}

/*

Console print:

wrote 19 characters

VS Output print:

OutputDebugString sample 1

OutputDebugString sample 2

Hello world and 88

*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  output