i want do like this
class A: public ...
bool isInherit(string strObj)
If you really need to receive a string at run time (e.g., something entered by a user), you need reflection; but C++ does not have reflection. The closest thing is RTTI (run time type information); personally, I try not to use it (never found myself in a situation where the overhead is justified).
If you can know which two classes you're checking for inheritance at compile time, google
Also, you may be interested in the LOKI code library, or BOOST; they have templates that show whether A inherits B. But those are advanced libraries. All of them are resolved at compile time, which is a good thing (zero runtime overhead).
Hope this helps,
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)