Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Need help with good OO design

Reply
Thread Tools

Re: Need help with good OO design

 
 
David Rubin
Guest
Posts: n/a
 
      06-26-2003
Joey Mukherjee wrote:

[snip - create an instance based on file data]
> delete science;
> delete housekeeping;
> delete telemetry;


> Since the file pointer is essentially shared with all three classes, the
> ifstream * defined in the base pointer will get deleted too many times.


> What is the best way to handle this problem? I cannot move the specific
> stuff into the classes which the FAQ suggests.


Set the file pointer to NULL in your destructor after you delete it?

/david

--
Andre, a simple peasant, had only one thing on his mind as he crept
along the East wall: 'Andre, creep... Andre, creep... Andre, creep.'
-- unknown
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need good book leads on Programming C++ (Design/Coding) for high performance systems. Kiran C++ 0 07-03-2007 10:28 AM
help: good sturdy C procedural program design John Gabriele C Programming 2 04-24-2004 04:13 PM
Looking for help/resources on Writing a nice detailed design / tech design for vb.net code SpamProof Java 3 12-01-2003 06:06 AM
Re: Need help with good OO design Bob Hairgrove C++ 0 06-26-2003 04:26 PM
Re: Need help with good OO design Victor Bazarov C++ 0 06-26-2003 04:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57