Re: Need help with good OO design

Discussion in 'C++' started by David Rubin, Jun 26, 2003.

  1. David Rubin

    David Rubin Guest

    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
     
    David Rubin, Jun 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SpamProof
    Replies:
    3
    Views:
    671
    SpamProof
    Dec 1, 2003
  2. Victor Bazarov

    Re: Need help with good OO design

    Victor Bazarov, Jun 26, 2003, in forum: C++
    Replies:
    0
    Views:
    722
    Victor Bazarov
    Jun 26, 2003
  3. Bob Hairgrove

    Re: Need help with good OO design

    Bob Hairgrove, Jun 26, 2003, in forum: C++
    Replies:
    0
    Views:
    737
    Bob Hairgrove
    Jun 26, 2003
  4. John Gabriele

    help: good sturdy C procedural program design

    John Gabriele, Apr 24, 2004, in forum: C Programming
    Replies:
    2
    Views:
    514
    John Gabriele
    Apr 24, 2004
  5. Kiran
    Replies:
    0
    Views:
    347
    Kiran
    Jul 3, 2007
Loading...

Share This Page