Dynamic Memory Allocation -- C++ Pointers Tutorial [8]

preview_player
Показать описание
Let's learn about dynamic memory allocation, what it is, how to use it and when to use it. We'll cover the new and delete operators and talk about memory leaks and how to avoid them. In this C++ programming tutorial for beginners, you'll learn through coding examples done using Visual Studio 2022 C++ Community.

In addition, you'll see how to create a new array and a new int using the new operator and how to free the memory by using the delete operator.

// Learn More

// Consider supporting this channel in multiple ways
Bitcoin: 177wfkQwzXiC8o2whQMVpSyuWUs95krKYB
Dogecoin: DRK2HDp3ZkkbFpvGZnVgMVosnBhPv8r3uP
Рекомендации по теме
Комментарии
Автор

I’m a second semester cpp student and you literally cleared up so much information compared to my hours of reviewing and reading online. Thanks bro

broozkej
Автор

I'm not a student of yours but I am a cs student. Thank you for the video. Your way of explaining it is very easy to understand. I see you have a whole catalog of videos so I'm definitely going to be relying on you to help understand the more difficult concepts

treyandrews
Автор

Excellent explanation, I love how meticulous you were when describing all the ins and outs. Great video!

rizzmaster
Автор

By far the best resource for learning about dynamic memory allocation! Using this video to study for my final next week :)

matthewhrndz
Автор

This is helping me in my second college c++ class!

linkofcrafting
Автор

One of the topics I've had the most trouble with and this explained what a full semester couldn't!

lorddoinkus
Автор

This was so easy to understand. Thank you! Best memory allocation video on YouTube!

BigCatSoftware
Автор

Best video on dynamic memory allocation

Truth_Seeker
Автор

Thank you for making this available! I can't wait for the next lecture.

Oph_gamez
Автор

Best explanation ever, would have loved to listen what you said before doing the outro haha, but anyway, thanks for these videos!

GEAG
Автор

Hey, hank, I really appreciate you for making this available to everyone l. Was this the last lecture on pointers for now?

sameaspastmueed
Автор

First of all great, amazing video but arent we supposed to reassign the pointer to nullptr...after deleting the memory?

stevenrashid
Автор

we had to watch a lot of commercial before we could even begin your tutorial

chiyang
Автор

Dear Professor, This is the best video on this topic I have come across. I want to know how can I get the "heap" memory address of the "new int" stored in int *n or int* o. Dereferencing n and o gives garbage output.

syedimadhaqqi
Автор

dynamic hair allocation failed 💀 (jk awesome video) u are awesome

mitchoulina
Автор

im so frustrated, everyone says its so we can creat arrays whos size is defined by the user.
so why don't we just do
{
int size; cout<<"size>>"; cin>>size;
int array[size];
for(int x:array) cout<<'*';
}

itstheer
Автор

i think there is a mistake in the video. The memory for n (the pointer itself) is allocated on the stack when the main function is called. This allocation happens at runtime, not at compile time.. during compile time actual physical memory is not allocated to the variables because main is called like a normal function. n is allocated at run time not compile time . same with all other vars in the video.

qqqqssss
Автор

Why bald guy is always so fantastic af

張力文-bx
Автор

istn't an integer equals 8 bytes not 4?

alexander_kozin