I have a function in which standard output is redirected to a pipe.
I call the function from main, before calling the function, "cout" works fine. After the function, cout<< doesn't output anything, nor does write(1,"",..). But cerr could still output to console.
I think are those IO redirect in the function make cout not work in main.
Is there anyway I could use cout in main ,after the function, to out put to the screen? What's the difference between cout and cerr?
THANKS!