如何在Visual Studio中写入“输出"窗口? [英] How to write to the Output window in Visual Studio?
本文介绍了如何在Visual Studio中写入“输出"窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应该使用哪个函数将文本输出到Visual Studio中的输出"窗口?
Which function should I use to output text to the "Output" window in Visual Studio?
我尝试了 printf()
,但没有显示.
I tried printf()
but it doesn't show up.
推荐答案
OutputDebugString 函数将执行此操作.
示例代码
void CClass::Output(const char* szFormat, ...)
{
char szBuff[1024];
va_list arg;
va_start(arg, szFormat);
_vsnprintf(szBuff, sizeof(szBuff), szFormat, arg);
va_end(arg);
OutputDebugString(szBuff);
}
这篇关于如何在Visual Studio中写入“输出"窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文