inheritance question
From: Dan Moos (dan.moos_at_verizon.net)
Date: 06/06/04
- Previous message: Ralmin: "Re: print matrix"
- Next in thread: Mark : "Re: inheritance question"
- Reply: Mark : "Re: inheritance question"
- Reply: Jeff Schwab: "Re: inheritance question"
- Reply: Chris Val: "Re: inheritance question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 06 Jun 2004 07:19:53 GMT
ok, here goes.
Say I have a base class:
class BaseClass {
public:
static int SomeVariable;
};
next, say I have some derived class
class Derived : public BaseClass
{
};
by making SomeVariable a static member of the base class, is this a good way
to provide a sort of global variable to the entire hierarchy without
breaking encapsulation? I realize some method to insure proper
initialization of the variable is needed, and that there may be some
overhead in my constructors in order to test the status of SomeVariable,
buit is this otherwise a good idea? if not, what is a good alternative?
- Previous message: Ralmin: "Re: print matrix"
- Next in thread: Mark : "Re: inheritance question"
- Reply: Mark : "Re: inheritance question"
- Reply: Jeff Schwab: "Re: inheritance question"
- Reply: Chris Val: "Re: inheritance question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|