C++ Objects: Stack vs. Heap

preview_player
Показать описание
This video explains how we can create C++ objects in the Stack or in the Heap of our memory.

As C++ programmers, we are responsible for memory management. When we create objects with C++, we can create them in the Heap or in the Stack.

In this quick overview we'll understand what is the main difference between stack and heap, and how we can use C++ to allocate and deallocate resources for our objects using these two options. We will also review what "new" and "delete" are in C++ and what are their responsibilities.

For comprehensive courses on computer science, programming, and mathematics, visit:

Don't forget to subscribe to receive updates and news about new courses and tutorials:

Have fun!
Рекомендации по теме
Комментарии
Автор

This is one of the best explanation I've ever seen on this topic.

d.h.y
Автор

This is one of the best masters of games I know. Excellent explanation full of details.

pollirodrigo
Автор

Good explanation, looking forward to watch the other videos on other topics.

simaobonvalot
Автор

Thank you, you are so great at teaching!! 😄

baringkiron
Автор

13:05 What could go bad if free is used for de-allocation but destructor is not used? I mean instead of delete if one uses only free what would happen?

jamesmasonic
Автор

Really great explanation but there's one thing that i still don't get: when you talk about Enemy* enemy = new Enemy(), you say at 8:30 that "an object is a pointer to something in memory" and immediately afterwards you "all we have is a pointer to an object". So we have an object, enemy, allocated in stack which is pointing to an object allocated in heap? Why enemy is considered also an object and not just a pointer to an object? In simple words, is a pointer to an object considered to be an object?

federicoriva
Автор

Could you upload the 3d software renderer with C language to Udemy? I love the platform there

notovertaken