Tag: inheritance
All the articles with the tag "inheritance".
-
Object Slicing in C++: Why Your Derived Class Loses Its Data
Learn what object slicing is in C++, why assigning a derived object to a base variable silently drops data, and the three reliable ways to prevent it.
-
Virtual Destructor in C++: Why You Need One and When
Learn why C++ needs virtual destructors. See the memory leak that happens without one, the one-line fix, and the simple rule for when to add one to a class.