Mohamed Ahmed Nabil Mohamed Ahmed Nabil - 1 year ago 71
C++ Question

C++: What is a stream

I have been hearing about stream, more specifically file streams.

So what are they?

Is it something that has a location in the memory?

Is it something that contains data?

Is it just a connection between a file and an object?

Any help would be appreciated

Answer Source

The term stream is an abstraction of a construct that allows you to send or receive an unknown number of bytes. The metaphor is a stream of water. You take the data as it comes, or send it as needed. Contrast this to an array, for example, which has a fixed, known length.

Examples where streams are used include reading and writing to files, receiving or sending data across an external connection. However the term stream is generic and says nothing about the specific implementation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download