[gmpi] Re: C++ detail question

On Thu, Mar 03, 2005 at 10:01:09AM +1300, Jeff McClintock wrote:
> >OK, so second question.  If I cast a "struct Foo *" to a "class CFoo *",
> >what happens?  Can I use non-virtual methods on it?  Can I use virtual
> >methods on it?
> >
> >Obviously, I could not access any data members that are part of CFoo but
> >not Foo, right?
> 
> Well no. Since CFoo inherits from Foo, a pointer to CFoo can access Foo 
> members (provided they're public of course).

Re-read what I wrote :)  A CFoo that came from a Foo can access Foo
members but not CFoo members.

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: