On Aug 16 11:14, 1997, Cliff Rhodes of 1:106/2000 wrote:
G'day Cliff,
BL>>Is this to much..
BL>>manifest::manifest(){
BL>> filename = new char[FILENAME_MAX];
BL>> while (!select(filename, FILENAME_MAX - 1));
BL>> mstreamp = new ifstream(filename);
BL>>}
Sometimes i want to initialize a number of variables in the constructor, in
that case i normally have a public variable( call it initsuccess). This way
the class can refuse all consequent calls with a single if() if the init
failed on any item.
Don't know how artistic that aproach is, but it works fine for me. :-)
CR> Not necessarily although it does pose some problems with error
CR> handling (which you could do with exceptions). Your options are to
I've been thinking about this for a while, is there a technical reason
why constructors are not able to return a value ?
Regards, Frank
--- Msged 4.00
---------------
* Origin: The ticking point, Melbourne, Australia. (3:635/728.21)
|