繁体   English   中英

如何实现部分 output 到 cmd window 和部分重定向到 Z6CE809EACF90BA1265B40FA4BD909 程序的文件?

[英]How to achieve partial output to cmd window and partial redirection to file for c++ program?

I know how to use pipe operator to redirect whole output of a c++ executable file(generated by my c++ code),but the question is that there are some contents that do not need to redirect to file, but to cmd window. 在我对 c++ 编程的有限经验中,我想可能有某种重定向方法比重定向 pipe 运算符具有更高的优先级,但我已经尝试了多种变体,但它们似乎都不起作用。 有任何想法吗?

std::cout用于要重定向到文件的内容,将std::cerr用于要打印到命令 window 的内容。 使用>|进行正常重定向只影响前者。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM