Skip to main content

Posts

Showing posts from August, 2021

Streams & Files

  C++   The reason we titled this opening section as Stream I/O is because input/output operations in C++ occur in streams.  Streams are essentially a sequence of bytes that are sent from device to device.  A device can refer to an input device such as a keyboard, a disk drive or even across the network or output devices such as display screens, printers, etc.   These streams are typically raw bytes but they have meaning within the context of an application.  Consider a Microsoft Word document being opened from disk.  If you attempt to open it using a generic text editor, you won't see the proper representation of the information stored in the document.  Word uses many different formatting characters and other information that specifies how the document should appear inside the Microsoft Word application.  Opening it in Microsoft Word, the stream of bytes now have the actual representation of ...