簡體   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