Tag: memory
All the articles with the tag "memory".
-
Union in C++: What It Is and When You Should Use One
Learn what a union is in C++, how it shares one block of memory between members, how it differs from a struct, and when a tagged union is the safe choice.
-
How to Use Pointers in C++: A Complete Beginner's Guide
Updated:Learn how to use pointers in C++ with clear mental models and real code examples. Understand addresses, dereferencing, and why pointers matter, step by step.
-
C++ new vs malloc: What's the Difference and Which to Use
C++ new vs malloc explained: new calls constructors and is type-safe, malloc hands you raw memory. Learn the real differences and why new is preferred in C++.
-
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.