[英]C++ try/catch: OutputDebugStringW in catch block outputs twice?
[英]C++ OutputDebugStringW with newline
我想将新行附加到OutputDebugStringW。
OutputDebugStringW(Item.pItem);
pItem是LPCWSTR,而不是wstring,因此我无法通过说+“ / n”直接添加新行。
有人可以帮忙吗?
只需在对OutputDebugStringW
的单独调用中输出换行符即可:
OutputDebugStringW(Item.pItem);
OutputDebugStringW(L"\n");
如果由于某种原因您只想对OutputDebugStringW
进行一次调用,请首先构建一个字符串:
std::wstringstream ss;
ss << Item.pItem << L"\n";
OutputDebugStringW(ss.str().c_str());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.