For Advanced Readers
-
In C++, we create objects in two different ways. In first method, we declare the object directly, meaning without using pointer. In second method, we first declare a pointer to an object and then create the object with new operator. We use that object by dereferencing the pointer. As far as classification (or behaviour) of polymorphism is concerned, we are interested in knowing how the object is referred in source code. It may be used with or without pointer. If we are using objects without pointers, it leads to compile time polymorphism. If we are using objects with pointer, it may be either compile time polymorphism or run time polymorphism.
-
While overriding virtual functions, we should ensure that the signature and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access