Tag Archives: delete

Dynamic Memory in C++ (new and delete)

We looked at dynamic memory in C last week, so let’s compare it with dynamic memory in C++. Allocation In C++, if you want to allocate on the heap rather than the stack, you need to use the new operator. Just like the C equivalents, the new operator returns a void* pointer to the block […]