This site is no longer active and is available for archival purposes only. Registration and login is disabled.

maybe it's just too late (class derivation)


maybe it's just too late (class derivation)

Postby Moose or Chuck » Nov 8, 2001 @ 3:13am

Howdy,<br><br>Maybe it's too late (2am) but I am having issues thinking this one out.  I have a class that is derived from a base class.  This class adds a special function that is not found in the base class.  I am having issues calling this special function from my container class which holds anything of the base class or the derived class. How can I tell it to use the method from the derived class?  <br><br>I think that question is totally unclear.  good luck deciphering my brain fart.<br><br>- Ketamine
Moose or Chuck
 


Re: maybe it's just too late (class derivation)

Postby Dan East » Nov 8, 2001 @ 9:17am

Okay, you lost me with the "container" class. You need to construct a class of the derived type, not the base type. Say you have a class CBase, and CDerived. You can't create a CBase and access members in CDerived. You need to create a CDerived. That may not answer your question because I don't understand where the containter class fits in.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: maybe it's just too late (class derivation)

Postby Dips » Nov 9, 2001 @ 1:12am

<br>Try this one --- <br>Now in container class u might have declared <br>an object of base class to access the derived class but base classs does not have direct link<br>to its derived class---instead of that declare<br>the object  of derived class...<br>hope this helps <br><br>Regards
Dips
pm Member
 
Posts: 3
Joined: Nov 9, 2001 @ 1:12am


Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron