Tuesday, 10 September 2013

Key Properties of C++ Inheritance

The base/derived class relationship is explicitly recognized in C++ by predefined standard conversions
 i.e., a pointer to a derived class may always be assigned to a pointer to a base class that was inherited publicly. But not vice-versa.
When combined with dynamic binding, this special relationship between inherited class types promotes a type-secure, polymorphic style of programming.
     – i.e., the programmer need not know the actual type of a class at compile-time.
     – Note, C++ is not arbitrarily polymorphic.
    - i.e., operations are not applicable to objects that don’t contain definitions of these operations at some             point in their inheritance hierarchy.



No comments:

Post a Comment

Blog Archive