Get Base Class name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scorpion06
    New Member
    • Mar 2007
    • 11

    #1

    Get Base Class name

    Hello,
    I would like to know how can i get the name of the base class of my object,
    for example:

    class A{};
    class B: public A {};
    class C{}:public B{};

    C c;

    GetBaseClass(c) ;
    I would like that the fonction return me: C or B or A.
    because my application verify if c has a type of A or B or C else ......
    thanks.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by scorpion06
    Hello,
    I would like to know how can i get the name of the base class of my object,
    for example:

    class A{};
    class B: public A {};
    class C{}:public B{};

    C c;

    GetBaseClass(c) ;
    I would like that the fonction return me: C or B or A.
    because my application verify if c has a type of A or B or C else ......
    thanks.
    You could always create a method to return the type or some identifier, if there's no 'built-in' way to do this...

    Comment

    Working...