C++ IO Stream Concepts Review

12 Jun 2012

Recently I have to deal with C++ I/O interface extensively in my job. However, I had not used it directly for a while, so I decided to review/relearn a bit so that I can use it fluently.

At a first glimpse, I found it a bit confusing and complex, given the number of classes and their intertwined inheritance relationships. Then I picked up my old C++ textbook and went through the underlining design concepts of I/O Stream library. Suddenly, things became clear and intuitive.

Here I am going to outline what I had understood:

To conclude, to use C++ I/O interface, a programmer usually does not need to create a memory buffer himself/herself, just create the most appropriate stream class object and connect the object’s input and output end accordingly.