By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

what's stream?

P: n/a
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++

Jul 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.
Jul 8 '07 #2

P: n/a
On Jul 8, 4:40 pm, Simon Wollwage <wollwagesi...@yahoo.co.jpwrote:
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.
thank's alot

Jul 9 '07 #3

P: n/a
Virtual_X wrote:
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

Jul 9 '07 #4

P: n/a
On Jul 9, 1:21 am, Virtual_X <C.BsM....@gmail.comwrote:
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.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jul 9 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.