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
Maybe we can define other value for "y" string or something like that?
Example
Code:
#include <iostream>
int main(){std::cout<<"y\n";}
result(printed):
x
y
z
I would not want to change int main() method just maybe overriding the << for the string type?
Or maybe make cout invoke additional method?
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.