TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY JANKURA
from: BALOG PAL
date: 1997-04-01 18:24:00
subject: Streams

                             Hi, Jerry Jankura!
On 28 Mar 97  14:48:01 you wrote to Mike Walker
 JJ> Mike - Let me offer a few advantages of stream I/O
 JJ> 1. The same symbols (">") or function names are used to read
 JJ> from, or write to
 JJ> 2. Stream I/O is extensible, standard I/O is not. For example, you can
 JJ> 3. Stream I/O is parsed at compile time, stdio is parsed at run time.
 JJ> 4. If you're willing to derive objects from streambuf and iostream,
 JJ> you can build your own devices (perhaps a "modem" or an "ascii
You didn't mention the most important advantage(s): they kill negative
redundancy and eliminate need a (...) call.
With printf clones you must take care to keep the format string and all the
passed arguments consistent. And manually cast all the pases params to the
type in the string.    Failing to do so you'll encounter nasty bugs,
discovered only at runtime.  (In my experience they get a high percentage of
bugs surviving compilation.)  Using streams i/o the type is determined by the
compiler, looking directly the object you use as the parameter.
Paul
... An ounce of application is worth a ton of abstraction.
--- OS/2 Warp
---------------
* Origin: The FlintStones' Cave in BedRock (2:371/20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.