I
Immortal Nephi
cout object has stream buffer. It is derived from ostream object.
How many characters do stream buffer hold? Or…do ostream object
resize to increase stream buffer’s memory size if characters are full?
Is there a way to reread stream buffer and output to the screen
second time?
For example:
cout << “Hello World!”;
cout // ?? reread stream buffer
“Hello World!” is inserted into stream buffer. I did not add endl
manipulator because I did not want to flush stream buffer. Can I copy
cout’s stream buffer to another stream buffer before I flush cout’s
stream buffer?
Maybe I want cout object and fstream object to share one stream
buffer. Stream buffer is sent to the console screen while it is
written to the disk at the same time.
If you say yes there is a way, please post your example source code.
I am not too sure if streambuf object is the answer.
How many characters do stream buffer hold? Or…do ostream object
resize to increase stream buffer’s memory size if characters are full?
Is there a way to reread stream buffer and output to the screen
second time?
For example:
cout << “Hello World!”;
cout // ?? reread stream buffer
“Hello World!” is inserted into stream buffer. I did not add endl
manipulator because I did not want to flush stream buffer. Can I copy
cout’s stream buffer to another stream buffer before I flush cout’s
stream buffer?
Maybe I want cout object and fstream object to share one stream
buffer. Stream buffer is sent to the console screen while it is
written to the disk at the same time.
If you say yes there is a way, please post your example source code.
I am not too sure if streambuf object is the answer.