TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BENJAMIN L MCGEE
from: ANTHONY TIBBS
date: 1997-08-12 21:01:00
subject: Re: couple of ?`s

 BLM> 
 BLM> How do I handle errors in opening the ifstream? 
 BLM> 
 BLM> Is it a good idea perhaps, to just allocate space for filename within 
 BLM> the constructor and then handle everything else in a manifest::init() 
 BLM> member?  That would seem redundant to me but perhaps overloading 
 BLM> constructors is already redundant. 
 Though it is probably easiest (and simpler) to what you suggested, I
 will give you my recommendation.
 
 In a case like this, I'd define a Private or Protected 'int' variable
 "initFailed", and set it to 1 if the ifstream failed to open, 0 otherwise.
 You could then have Init() return 1 if that was set (without doing aynthing
 else).
 
 Hope that helps...
Sincerely,
Anthony Tibbs
... ****** Try it. It's "bound" to be fun ******
___ Blue Wave/DOS v2.30 [NR]
--- Maximus 3.01
---------------
* Origin: World of Power BBS * Private * Ottawa, ON (1:163/215.38)

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