TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ROGER SCUDDER
from: JONATHAN DE BOYNE POLLARD
date: 1998-02-04 16:43:00
subject: C++ Saveding stuff

 TM>> #include 
 TM>> #include 
 RS>  This code is about as likely to work as his pseudo code.
Not up to speed with the way things now work in the Standard C++ language ?
 TM>>     string name;
 TM>>     cin >> name;
 TM>>     if (name=="Cyber Con")
 RS>  That doesn't work.  You're comparing addresses.  Use strcmp.
He's doing nothing of the sort.  He's actually using the == operator defined 
for the standard string class.
 TM>>     ofstream("file1.fil") << name;
 RS>  You have to open the file before you can write to it.
 TM>> } 
 RS>  And close it when you're done
Tut tut!  Even in Classic C++ that snippet of code was perfectly acceptable, 
and did exactly the job required.  Go back to the manuals and read up about 
temporary objects and destructors.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

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