Tag: memory
All the articles with the tag "memory".
-
Dynamic Arrays in C++: How to Create an Array With a Runtime Size
Learn how to create a dynamic array in C++ with new and delete[], why sizeof breaks on it, how to resize one, and why std::vector is the safer choice.
-
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++.