Explanation:The class demo consists of two data members bx and by and class der_demo with just one
data member dx . When in the main function, d1 = d2 is written , only the inherited data members bx
and by are assigned to object d1 . The data member dx from d2 is not assigned to d1 . In effect, object d2
gets sliced. So ...
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.