上最简单的代码:

#include <iostream>
#include <Windows.h>
using namespace std;
int main()
{
OutputDebugString(L"输出调DD试信息123");
cout << "Hello World!\n";
}

这个代码就是在控制台输出HelloWorld;

然后OutputDebugString的东西,是输出在调试窗口中;

运行结果:

 

C++:OutputDebugString作用(以VS2019为演示例子)_#include

 

所以OutputDebugString作用就是类似于printf/cout/print  不过是输出在调试窗口界面当中,相信大家了解了,比较简单。