What is a bidirectional stream?

I presume something like

fstream fs("output.txt", ios_base::in|ios_base::out);

but what exactly is the nature of a bidirectional stream? What are their usages?
(Also fstreams are both in and out by default, correct?)
A bidirectional stream is one that you can both read from and write to. As for their usages, they're pretty limited with the exception of networking sockets. If the file is small enough then you are far better off loading the whole thing into memory and doing any editing from there and then writing it back out. If the file is too large then you should use a File View of the file and edit it that way, which is again from memory. I guess this is more of an opinion then a fact.
Last edited on
Topic archived. No new replies allowed.