jeudi 1 mai 2014

IO redirect: cout not working in main


Vote count:

0




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!



asked 30 secs ago

fuiiii

107





Aucun commentaire:

Enregistrer un commentaire