fflush(stdout) in c

前端 未结 4 1984
谎友^
谎友^ 2021-01-14 09:10

Right when I am at fflush(stdout) and I break there in GDB, can I know what is there in stdout before I actually print it?

How can I know what is there in stdout at

4条回答
  •  太阳男子
    2021-01-14 09:59

    use "setbuf()", and keep a handle to the buffer, which you can peek at. Unfortunately, I don't know off the top how to find the offset and length of unflushed data.

提交回复
热议问题