Тёмный

C#: The Heap and the Stack 

Подписаться
Просмотров 36 тыс.
% 1 277

When programming in C#, it is very important to understand the concept of the heap and the stack. Value types such as integers are stored on the stack. Object types are stored on the heap, with pointers to them stored on the stack. This video explains the heap and the stack with an example and a diagram and demonstrates the dangers that await you if you do not understand this concept.

Опубликовано:

 

5 мар 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 48   
@yawnyawning
@yawnyawning 2 года назад
so far the easiest explanation of stack and heap ive seen
@yasu3d
@yasu3d 4 месяца назад
I've been programming with c# for 2-ish years. I had a solid understanding of certain types being passed by reference instead of value, but never learned what the Heap or Stack *actually* were. This video finally made it click in my head. I'm glad I wasn't missing out on much and just learned some new names for stuff I already kinda knew :]
@kipchickensout
@kipchickensout 2 года назад
For anyone watching: You can pass value types by reference, by simply prefixing the type in the parameters with a "ref" keyword. Also look up the "out" keyword
@unrealdevop
@unrealdevop 4 года назад
This is amazing, great job man. This taught me something very valuable that I was completely unaware of before. Not sure why this wasn't properly explained in the books I read.
@gregorio87
@gregorio87 10 месяцев назад
The best explanation I've seen... I remember being a bit confused about this behavior when first learning JavaScript and this nails it in a very clear way. Great job
@DylanWRose
@DylanWRose 3 года назад
Preparing for the MTA Software Development Fundamentals exam to meet entry requirements for the WGU Data Analytics degree program. This is something that pops up on the test and has always confused me. The way you've explained it is extremely clear. Thank you.
@prasadmadushan
@prasadmadushan 2 года назад
Clear explanation with visual Diagram. love it.
@TG47GRG
@TG47GRG 3 года назад
this is awesome. You made the concept sound very simple and easy to understand. Thank You!
@yess.6558
@yess.6558 6 месяцев назад
Great video! Thank you!
@dineshkarn3275
@dineshkarn3275 2 года назад
Very best explanation with practical example. Thanks a lot . Waiting for your next video
@persiansayed
@persiansayed Год назад
Great demonstration and explanation. Thanks 👍
@moherna3323
@moherna3323 3 года назад
You're such a great educator
@prakashroyal6386
@prakashroyal6386 Год назад
Clear explanation. Thank you for the video!!
@PatilSandip321
@PatilSandip321 Год назад
Nice one
@developersfield9018
@developersfield9018 6 лет назад
nice and easy to understand explanation...
@Tanveer048
@Tanveer048 2 года назад
Thanks for the Sharing of your knowledge
@gregorynovikov1450
@gregorynovikov1450 2 года назад
This was interesting, Thank-You
@mohamedshaban5170
@mohamedshaban5170 Год назад
Thank you!!
@aliabusaleh4039
@aliabusaleh4039 3 года назад
thanks man great job
@BlackSaintNiks
@BlackSaintNiks Год назад
Great Learning Video!
@AnasJayyusi
@AnasJayyusi Год назад
thank you that was amazing explain
@blackbarry45
@blackbarry45 4 года назад
thanks you so much
@shamikaredkar837
@shamikaredkar837 3 года назад
why did i understand this better than what my uni prof taught me? and why am I paying thousands of dollars to the uni only to learn stuff off youtube?
@vanyang5381
@vanyang5381 3 года назад
dud I feel exactly the same lol
@user-ee5lx8rz3j
@user-ee5lx8rz3j 8 месяцев назад
excellent
@mohokhachai
@mohokhachai 10 месяцев назад
Finally some one
@hhcdghjjgsdrt235
@hhcdghjjgsdrt235 2 года назад
best example
@RageGames_
@RageGames_ 8 месяцев назад
Nice
@muammar88
@muammar88 2 года назад
Super! Subscribed! ps. would you kindly group your videos by programming language into seperate PlayLists for convinence? Thanks a million for the great contents!
@Tanveer048
@Tanveer048 2 года назад
This super 👌
@burreifort
@burreifort 2 года назад
4:10 No, you didn't change the value of score2
@macoson
@macoson 11 месяцев назад
Yes, this got me to laugh as well :D
@gabrielyea
@gabrielyea 5 лет назад
In c# by default everything passes by value, classes pass their reference as a value. That is my understanding, or I am wrong?
@at3o
@at3o 2 года назад
💯
@mujmoh7471
@mujmoh7471 7 месяцев назад
أسطورة
@mohokhachai
@mohokhachai 10 месяцев назад
This is it
@ozanbarsakdogdu8360
@ozanbarsakdogdu8360 3 года назад
in the end of the video you say "int s". Was it "int score"
@cicher
@cicher 3 года назад
Good explanation, but it is not really about "Heap and Stack", the title should be *"Value and Reference types"*
@wwg681
@wwg681 3 года назад
Can we use struct all the time?
@Luizzzzzzzzzzzzzzzzzzzzzzzzzz
@Luizzzzzzzzzzzzzzzzzzzzzzzzzz 3 года назад
Hey have you found the answer to your question?
@wwg681
@wwg681 3 года назад
@@Luizzzzzzzzzzzzzzzzzzzzzzzzzz Nope :(
@alissonreinaldosilva1119
@alissonreinaldosilva1119 3 года назад
@@wwg681 it's not like Struct is an alternative or replacement for Classes, they have different purposes. Depending on how simple your program is, then yeah you can use only struct, nothing will enforce you to use classes (apart from Program class e.g in a console), but depending on your needs it will just make your task harder for no good reason.
@Atezian
@Atezian 2 года назад
Is this useful to someones that doesnt know what the stack and the heap are?
@edward481
@edward481 2 года назад
Yes.
@metteby
@metteby 5 лет назад
Good explanation. Please lower keyboard noise
@Mr.Epsilion
@Mr.Epsilion 2 года назад
Spassibo = true;
@BerikAssylbekov
@BerikAssylbekov 2 года назад
It's wrong. Reference type parameters are passed by value. You can test yourself by setting r = null; The pointer on "r" is removed, but "report" is still has pointer.
@WiseWeeabo
@WiseWeeabo 4 года назад
would be useful if you could actually see the text you're writing, how did you mess it up so badly?