Tag: OOP
All the articles with the tag "OOP".
-
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.
-
The Rule of Three in C++ Explained (with Examples)
The Rule of Three in C++: if your class needs a destructor, copy constructor, or copy assignment, it usually needs all three. Learn why, with clear examples.
-
Friend Functions in C++: What They Are and When to Use Them
Learn what friend functions and friend classes do in C++, how they access private members, and when using one is the right call instead of a getter method.
-
The this Pointer in C++: What It Is and When to Use It
Learn what the this pointer means in C++, why every member function has one, and when you actually need it — shadowed parameters and method chaining explained.