<< Effective C >>, Scott Meyers Item 36: Differentiate between inheritance of interface and inheritance of implementation.The notion of (public) inheritance turns out to be composed of two separable parts: inheritance of function interfaces and inheritance of function implementations.As a class designer, we sometimes want our derived classes to inherit only the interface of a member function; sometimes we want derived classes to inherit both the interface and the implementation of a member function and allow them to override the impementation inherited; sometimes we want derived classes to inherit both the interface and the implementation of a member function without allowing them to override anything.Here goes the example class hierarchy for representing geometric shapes in graphics application:
Shape is an abstract class; its pure virtual function draw make it as such As a result, clients can not create instances of Shape class, only of the classes derived from it To achieve Consider the pure virtual function draw The two... most salient features of pure virtual functions are that they must be redeclared by any concrete class inherits them, and they typically have no definition in abstract classes.The purpose of declaring a pure virtual function is to have derived classes inherit a function interface only that. by declaring draw as a pure virtual fuction, we just tell the designers of subclasses, "you must provide a draw function, but I have no idea how you're going to implement it." to achieve to be continuedTo achieve < Goal3> to be continuedThe above writing is almost a copy from the book, just for my English spelling and C learning.Wondering how things work out about the new function overriding features like explicit overriding, renamed overriding and multip le overriding in C / CLI. Will it bring new applications on inheritance model above? Or simply have no connections here.About Indigoa mark for further reading.Arraya mark for further reading.Retangular array and Jagged array (array of array?).