what's stream?

V

Virtual_X

it's only language confusion
i am non-english speaker

so i heard about stream in alot of c++ tutorials

ie: in iostream and in sstream headers

in sstream we use the class stringstream to convert string to
numerical and i know that
stringstream class allows a string-based object to be treated as a
stream

in my dictionary streams have more than one meaning such as
"river , table"

so what's the meaning of stream in c++
 
S

Simon Wollwage

Am Sun, 08 Jul 2007 23:21:20 +0000 schrieb Virtual_X:
it's only language confusion
i am non-english speaker

so i heard about stream in alot of c++ tutorials

ie: in iostream and in sstream headers

in sstream we use the class stringstream to convert string to numerical
and i know that
stringstream class allows a string-based object to be treated as a
stream

in my dictionary streams have more than one meaning such as "river ,
table"

so what's the meaning of stream in c++

The word "stream" is used because streams are used to let data "flow".
So, in stringstream for example, the string data "flows" from the string
to the output or from the input into the string.
 
V

Virtual_X

Am Sun, 08 Jul 2007 23:21:20 +0000 schrieb Virtual_X:









The word "stream" is used because streams are used to let data "flow".
So, in stringstream for example, the string data "flows" from the string
to the output or from the input into the string.

thank's alot
 
S

Stuart Redmann

Virtual_X said:
it's only language confusion
i am non-english speaker

so i heard about stream in alot of c++ tutorials

ie: in iostream and in sstream headers

in sstream we use the class stringstream to convert string to
numerical and i know that
stringstream class allows a string-based object to be treated as a
stream

in my dictionary streams have more than one meaning such as
"river , table"

so what's the meaning of stream in c++

IMHO, stream is a bit of a mis-leading term (especially for non-native speakers
like me). If you think of streams objects as objects that describe the flow of
information, you rather expect the attribute "throughput", "source", and "sink".
But if you take a lock at how streams are used, you'll come to the conclusion
that streams _are_ the sources or sinks of information.

If you are a computer scientist that has majored in theoretical computer
science, you'll probably associate the flows of information in a system with a
directed graph: The nodes (points) are the "sources" and "sinks", and if
information flows from a source node to a sink node, these nodes will be
connected with a directed edge pointing to the sink. Counterintuitively, the
term "stream" as it is used with regard to C++ doesn't refer to the edges in
such a graph but to the nodes. If you asked me, the term "stream" should be
replaced by "sink/source". Of course, this is never going to happen.

Regards,
Stuart
 
J

James Kanze

it's only language confusion
i am non-english speaker
so i heard about stream in alot of c++ tutorials
ie: in iostream and in sstream headers
in sstream we use the class stringstream to convert string to
numerical and i know that
stringstream class allows a string-based object to be treated as a
stream
in my dictionary streams have more than one meaning such as
"river , table"
so what's the meaning of stream in c++

In general, in computer science, a "stream" refers to a
sequential flow of data. What separates a stream from other
sequential IO is that it isn't broken up into records. It's a
stream of bytes, or characters, or some other very primitive
type.

Arguably, C++ streams aren't just streams, since they also do
formatting (conversions to an from text); at least some
specialists consider this to be the major abstraction of the
iostream classes (with actual streaming being left to
streambuf). Also, in C++, streams have a few extra functions,
which don't directly fit into this abstraction. But the
fundamental idea is very much one of a flow of primitive data
(even if a filebuf operating in text mode requires full lines,
i.e. records), and the extra functions (like seek[gp]) aren't
guaranteed for all types of streams.

PS: what dictionary gives "table" as a meaning of stream? The
relevant meaning in the American Heritage Dictionary (at
http://www.bartleby.com) is "A steady flow or succession",
everything else only applies to liquids, or is strictly British
school usage. The Merriam Webster (http://www.m-w.com) goes into
more detail, but still nothing even vaguely like table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,291
Messages
2,571,476
Members
48,143
Latest member
Manuelevimb

Latest Threads

Top