How to overload cout behaviour in C++?

前端 未结 1 1329
一个人的身影
一个人的身影 2021-01-21 16:18

I would like to make cout will always print additional string (above and under) whenever I call it. It is weird to me because I use in Java and C# primarily.

Edit

<
1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 16:34

    I don't think you can do this with cout. What you can do instead is create a simple I/O wrapper that does your extra printing and then calls into cout to do the real work.

    0 讨论(0)
提交回复
热议问题