TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: DARIN MCBRIDE
from: JAN BIJSTERBOSCH
date: 1998-02-25 19:30:00
subject: C++ Saveding stuff

Hello Darin,
19 Feb 98, Darin McBride of 1:250/102 wrote to Jan Bijsterbosch
[ question about default filestream being textmode type snipped ]
 DM> AFAIK, that's still the case.  Not a major deal on unix
 DM> systems, but seeing as most of us here are on Intel, ...
 DM> good thing to point out, Jan.  Some implementations use
 DM> ios::binary, others use ios::bin.  Unfortunately, I don't
 DM> know which one made it into the standard...
RS>> TM>     ofstream("file1.fil") << name;
 DM> This would be:
 DM> ofstream("file1.fil", ios::out | ios::binary) << name;
 DM> Or, more likely in binary mode,
 DM> ofstream("file1.fil", ios::out | ios::binary).write(name,
 DM> NAME_LEN);
Yes, I think the last one is the way to go. However it's prudent to create a 
derived class from (i/o)fstream to take care of handling various types 
reading and writing from and to such binary streams. 
There's a nice example in Tom Swans book "Code Secrets". Not that recent, but 
still very informative .
Greetings from sunny Amsterdam,
       Jan
email:bijster@worldonline.nl
http://home.worldonline.nl/~bijster
--- MBM v3.41e
---------------
* Origin: Snuffelaar bij DosBoss West (2:500/121.5122)

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™.