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)
|