View Single Post
Re: [C++] Class names
Old
  (#10)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: [C++] Class names - 25-08-2005

Quote:
Originally Posted by sfx1999
Whistler, I think what he means is that he wants the base class to be able to find out what the derived class is. Like this:

Code:
CBaseClass *instance = new CDerivedClass;
instance.identify();
If you use your method, wouldn't it always return the main class's name?
the main class's "GetDescription()" is virtual, so it should return the derived class's name.
  
Reply With Quote