Home  >  Q&A  >  body text

c++ - Xcode writes C language code, how to use freopen() to return the output to the console?

Excuse me, after I have defined stdout in a file, I want to return to the Xocde console and output the second hello in the console again. What syntax can I use to come back?

freopen("/dev/tty/", "a", stdout);Already tried but no response.

I have searched many places before, and I really don’t know how to solve it. This is my first time asking. Thank you very much, gentlemen.

曾经蜡笔没有小新曾经蜡笔没有小新2697 days ago977

reply all(1)I'll reply

  • 某草草

    某草草2017-06-23 09:16:56

    Try after fclose.

    reply
    0
  • Cancelreply