home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!rpi!news.ans.net!cmcl2!acf5!checker
- From: checker@acf5.NYU.EDU (checker)
- Newsgroups: comp.os.os2.programmer
- Subject: Re: AT&T enhancements for the DAP CD-ROM disk for $10. Worth it?
- Message-ID: <2106@acf5.NYU.EDU>
- Date: 15 Dec 92 05:58:06 GMT
- References: <Bz7L6w.3r8@cs.uiuc.edu> <19921214.065050.16@almaden.ibm.com>
- Organization: New York University
- Lines: 21
-
- lansche@torolab6.VNET.IBM.COM (Martin Lansche) writes about iostreams:
-
- > If you are doing stdio-type of programming, then (1) [streams] is
- > also useful. If you are doing PM programming, it is not.
-
- Actually, strstreams are very useful even if you never use stdio.
- Temporary formatting buffers are a breeze:
-
- char aBuffer[100];
- ostrstream Out(aBuffer,100);
-
- Out<<"This is a double: "<<1.34<<endl<<"An int: "<<234<<ends;
-
- They are ever so much easier to use than sprintf and safer; it's
- typesafe and it won't overflow the array. If you don't construct it
- with a buffer it dynamically allocates one for you and grows it as
- necessary. Don't forget the ends at the end or you won't have a null
- terminated buffer.
-
- Chris
-
-