How does <iostream> work? (C ++)
4 answers
For a detailed guide to IO streams, see Standard IOStreams and C ++ Locales . After reading, I suspect that it will be convenient for you to manage with the status quo - IOStreams is probably the most difficult part of the C ++ standard library.
+9
anon
source
sharestreambuf. streambuf . fstreambuf; cout streambuf. , cout streambuf , , .
A common template is "filtering streambuf", which is the streambuf interface that converts its input before sending it to another streambuf. This can be combined with cout: take out the original streambuf, wrap it in a filtering streambuf, and put this wrapper back in cout. You do not need to know how the original streambuf works.
+1