要使用OutputDebugString打印字符串变量中的消息,可以按照以下步骤进行操作:
#include <Windows.h>
char msg[] = "Hello World!";
OutputDebugString(msg);
完整的示例代码如下:
#include <Windows.h>
int main()
{
char msg[] = "Hello World!";
OutputDebugString(msg);
return 0;
}
注意:OutputDebugString函数在调试模式下有效,在发布版本中不会产生任何输出。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
相关推荐:python如何打印字符串变量