queue is an abstract data type with two operations:
dequeue() (or sometimes
pop()) that have first-in-first-out semantics.
stream is hard (for me) to describe abstractly. My best cut at it is that it is an abstraction representing a buffered file (where "file" is understood in the Unix sense of the word as something that is usually (but not always) a sequence of bytes and a current file position.)
At it's most general a stream is like a sequence of bytes numbered from 0, that can be arbitrarily extended at the end, but that has some additional state (the current position). There are some basic operations (
fwrite()) that read or write an arbitrary number of bytes starting at the current position, and then reset the current position to point just after the most recently read or written byte. The current position can also be changed with
fseek() and queried with
Now here's where it gets "icky." At the time a stream is opened a variety of factors determine which of the above operations are enabled or disabled. If you open your stream only for read then calling
fwrite() will cause an error. If you open your stream only for write then calling
fread() will cause an error. If your stream is actually a pipe or a socket, or is opened in mode append then you are not allowed to
fseek(). You are only allowed to read or write from the current file position.
stderr are pipes so you can't
fseek() them. You can't
stdin and you can't
C++ fixed most of that mess by giving us a hierarchy of types (for example: http://www.cplusplus.com/reference/istream/basic_iostream/), so that we can do error recovery with RAII and can also tell whether the file is readable or writable by looking at the type (although I don't know offhand whether they fixed the seeking mess.)
But then there's the whole other question of formatted output. C has
fprintf() which formats some stuff and puts some bytes into a writable stream (starting at the current file position). C++ replaced
fprintf() with the (IMHO) really-much-too-cute
operator<<() has the advantage of being strongly typed, but the extreme disadvantage of requiring the use of
operator<<() puts some bytes to the output stream starting at the current file position, but formatted based on a whole bunch of state that is mutated by manipulators. So a C++ stream actually has a bunch of extra state that you need to know about. (Whether integers are going to get formatted hex or decimal from now on, how much precision floats are printed with, etc.)
queue inserts and removes individual items of a well defined type from its front or its back. A
stream is random access extendable array of bytes where you can read and write arbitrary numbers of bytes from the current file position (except when it isn't random access and except when you either can't read or can't write).