C# Heap vs Stack explained

  Рет қаралды 3,244

Hubert Mijalski

Hubert Mijalski

Күн бұрын

Пікірлер: 8
@HarleyPebley
@HarleyPebley 2 жыл бұрын
Just discovered your channel a week or two ago. Good stuff. And thanks for increasing the text size in the editor on this video. The previous videos were hard to read for these old eyes. Two minor points: 1. On the initial slide showing the stack and heap, technically the reference type fields in Books (the strings) should point to other places in the heap. They're not inside the Book class directly as implied by the diagram. Although, depending on the level of abstraction you want to work at, it could be argued the slide was acceptable for an introduction. 2. Minor point at 7:46: I'm pretty sure when you pass in a ref parameter on a reference type, what's passed in is the pointer to the pointer. If it was just passing the pointer, then that copy of the pointer would be local to the stack of the method being called and wouldn't update the value for the caller. Keep up the good work! Peace!
@hubertmijalski
@hubertmijalski 2 жыл бұрын
Thanks for the feedback, you're right in both and both were done for the sake of simplicity just to illustrate the overall point, but you're absolutely right. Thanks!
@Raid77
@Raid77 2 жыл бұрын
Hello I'd like to ask you why doesn't this work for strings if they are on the heap as well? I tried something similar to your example and whenever I changed one of the strings the other one didn't change 😶
@vivekkaushik9508
@vivekkaushik9508 2 жыл бұрын
cuz strings are immutable?
@cloudstrife7083
@cloudstrife7083 2 жыл бұрын
always funny to me when young programmer who never knew pre managed programming talk about heap vs stack in a managed language... in C++ ok but not in C# :\ weird in a way but I still understand what your trying to do/teach
@vivekkaushik9508
@vivekkaushik9508 2 жыл бұрын
how old r u good sir?
@cloudstrife7083
@cloudstrife7083 2 жыл бұрын
@@vivekkaushik9508 44
@ripleylester4527
@ripleylester4527 2 жыл бұрын
🌟 『p』『r』『o』『m』『o』『s』『m』
Basics of Dependency Injection
11:56
Hubert Mijalski
Рет қаралды 343
КОНЦЕРТЫ:  2 сезон | 1 выпуск | Камызяки
46:36
ТНТ Смотри еще!
Рет қаралды 3,7 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
What is Span in C# and why you should be using it
15:15
Nick Chapsas
Рет қаралды 264 М.
C# Fundamentals - Stack, Heap, and References
30:42
Rainer Stropek
Рет қаралды 3,7 М.
Every Developer Should Know This
15:38
ArjanCodes
Рет қаралды 33 М.
Builder Design Pattern in C#: Coding Examples
15:51
Jotsna Waghmare
Рет қаралды 46
Where are types allocated in .NET and why people get it so wrong
14:35
Stack vs Heap Memory - Simple Explanation
5:28
Alex Hyett
Рет қаралды 278 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 129 М.
Pointers and dynamic memory - stack vs heap
17:26
mycodeschool
Рет қаралды 1,5 МЛН
КОНЦЕРТЫ:  2 сезон | 1 выпуск | Камызяки
46:36
ТНТ Смотри еще!
Рет қаралды 3,7 МЛН