Sabtu, 11 Februari 2017

How to perform object slicing in C++

In inheritance we can assign a derived class object to a base class object. But, a base class object cannot be assigned to a derived class object. When a derived class object is assigned to a base class object, extra features provided by the derived class will not be available. Such phenomenon is called object slicing.   Following program demonstrates object slicing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

The post How to perform object slicing in C++ appeared first on Coding Security.


How to perform object slicing in C++
read more

Tidak ada komentar:

Posting Komentar