Understanding how memory in managed is an essential concept in computing. This video explores memory management in the context of the C programming language.
Пікірлер: 67
@Bestcuriosity_12 жыл бұрын
Today I found real teacher who can make me love c programming to go deep dive in this field thank you sir for making such beautiful lecture series for us graduate student who got stuck in such hard concepts which was explained by you in easy manner. Huge Respect & love from India
@rotrose75313 жыл бұрын
Thank you very much, it it difficult to find real c programming tutorials, and u provided a perfect one. Please do not stop
@jonathanmuckell98273 жыл бұрын
Thanks for the encouragement! Glad you found this helpful.
@milosb7932 ай бұрын
I've been learning this on the university for couple of years, and none made me understood this that good as you. Really quality content. Thank you and keep pushing!
@redmundperrz723428 күн бұрын
Finally its crystal clear now for me this topic
@hadiasghari22663 жыл бұрын
Studying CS in Germany and by far you are the best. NO ONE can explain it like you. Shame on my Prof
@yonatanam1 Жыл бұрын
Global variables are accessible even from other c modules by using the extern statement. However, if u add static to the global variable, then it is not accessible from other modules. This means that you can define another global static variable with the same name in another module, and it will be separate from the first one which was declared in the other module.
@insoft_uk8 ай бұрын
I use static as well not all the time just as you pointed out it’s actually an important part to know so one knows when it’s needed or not and also used for functions I think he made a big mistake as beginners looking at this video are going to think it’s optional and not necessary at all.
@jakenguyen25842 жыл бұрын
Awesome video, Jonathan. Your slow, detailed explanations really help with drilling the points into my slow brain.
@davidjiang79293 жыл бұрын
This is a really good explanation of the variable lifetimes. I came here because programming language analysis class just introduced this, and the textbook did not have good explanations on these concepts.
@wilfredv1930 Жыл бұрын
Your videos about programming are a treasure. thanks a lot!
@BigManTing5062 жыл бұрын
You're so good at explaining concepts!
@onuryorutken55403 жыл бұрын
Great video with great examples!!! Thank you very much.
@andyburris2555 Жыл бұрын
Great video for reviewing these concepts. Correct and concise.
@tlwilkinson2 жыл бұрын
This is the best video online explaining heap and stack.
@ProfessorLinux Жыл бұрын
I appreciate this series. You are a great teacher.
@jackm.16282 жыл бұрын
Fantastic explanations, thank you professor!
@douglasthomson29862 жыл бұрын
Great explanation and super useful. Thanks from the UK.
@hubercats3 жыл бұрын
Thanks for sharing this very clear, helpful video!
@MrOse-nh5pd2 жыл бұрын
You're truly a good teacher. 👍
@rajeshhariharan75752 жыл бұрын
Wonderfully explained; thanks a lot Prof. Jonathan Muckell
@oliverkobing47263 жыл бұрын
What a great teacher!
@pietraderdetective89533 ай бұрын
Amazing explanation on this memory topic. Well done Sir, well done!
@aminedoughmi85822 жыл бұрын
excellent course ! keep up the good work
@m.houdeib3 жыл бұрын
Perfectly explained.
@shitinsideyou10 ай бұрын
Great video, thank you!
@nicolasbourbaki8896 Жыл бұрын
I wished I had watched this video when I started c coding! Damn job explaining pointers!
@sallaklamhayyen98762 жыл бұрын
Jonathan Muckell you are a wonderful teacher great job thank you so much please continue
@m4tchm4k3r53 жыл бұрын
thank you very much, really helpful. You are gold.
@acluster34117 ай бұрын
Great teaching!
@mylogs8582 жыл бұрын
Best explanation! And I like the visual aids.
@lunaxiao9997 Жыл бұрын
Great video! Well explained
@denjiuzumaki430924 күн бұрын
nice examples!!
@guliyevshahriyar Жыл бұрын
Thank you very much teacher.
@mutalibgozalov72084 ай бұрын
Thank U sir, that was helpful
@arslanarslan94322 жыл бұрын
Thank u, you are amazing !!!!!!!
@ii7mdj_3538 ай бұрын
Yoooooooooooooooooooo, that makes so much sense now.
@ArunKumar-ll9lo3 жыл бұрын
A very good informative session. Keep it up..
@jonathanmuckell98273 жыл бұрын
Glad you liked the video!
@bwzd Жыл бұрын
the stack vs static memory example at 10:00 really made something click for me
@rodolfokey78352 жыл бұрын
Hi Jonathan, thank you for the video. It's very didactic. I have a question: can you access a location in the heap memory (previously allocated with malloc or using "new" in C++) from any function in any class different from the one where the allocation was made? If so, what is the syntax. Thank you
@THawpeek20063 жыл бұрын
Nice video with good explanation thanks bro for this
@jonathanmuckell98273 жыл бұрын
Glad it was helpful!
@sendlocation84762 жыл бұрын
@Jonathan Muckell @Anyone So does that mean when you push the first thing onto the stack. It always occupies the highest memory address first? So it allocates at the very top?
@echoptic7752 жыл бұрын
8:00 doesnt static in c mean that its a private variable/function for that file only?
@user-ld8ru7kh6u4 ай бұрын
May i know what is the purpose of storing address in a pointer when anyways the variable is not removed in heap memory?
@spacewad87452 жыл бұрын
23:00 sizeof is an operator
@Byynx23 күн бұрын
Since HEAP has unlimited memory space available, is the HEAP inside the process memory region or outside ?
@user-kf1xn1dq9t3 жыл бұрын
Does such system of memory regions applies to all languages (C family, Python, Java, etc.) or only to C specifically?
@jonathanmuckell98273 жыл бұрын
The memory regions is are used across programming languages. It's a computing fundamental that is supported by both the operating system and the underlying hardware architecture. Many programming languages try to hide some of the messy details from the programmer (C gives you a lot more control). For example, in Java when you use the keyword "new" you are allocating memory space on the heap. The programmer never needs to free this memory, since Java uses a concept called Garbage Collection that automatically frees memory that will no longer be accessed.
@user-kf1xn1dq9t3 жыл бұрын
@@jonathanmuckell9827 not exactly what I meant to ask. I meant "is such memory layout/arrangement (stack at the "beginning" of RAM, heap near the "end", and they grow towards each other; static located "outside" of range that memory range between heap and stack) is a standard way of memory representation for all programming languages (regardless is it have manual (C, C++) or automatic (C#, Java) memory management) or such approach specific only to C? For example, if I write char * heap_char_1 = new char; char * heap_char_2 = new char; char * heap_char_3 = new char; char stack_char = "a"; in C++, on computer that have only 100 bytes of RAM, and then print addresses of all four characters into console heap_char_1 would have address 100, heap_char_2 99, heap_char_3 98 and stack_char 0, or something like that?! Or that would be true only in C?
@jonathanmuckell98273 жыл бұрын
@@user-kf1xn1dq9t OK - Good question. It is language independent, since it is enforced at the hardware-level. For example, here is an example of the MIPS architecture. If you look on the second page, you can see the documentation for the MIPS processor's memory allocation. Stack grows from a high address down, while the heap grows from a lower address up. This is common practice across various processor architectures. courses.cs.washington.edu/courses/cse378/09au/MIPS_Green_Sheet.pdf
@user-kf1xn1dq9t3 жыл бұрын
@@jonathanmuckell9827 huh, I did not expected that it enforced by hardware. Thank you for clarification. One last question, which is outside of video topic I think. What if I have two programs, HelloWorld and FooBar, running at the same time, probably on different threads, on a single computer. How OS would manage memory for them in this case? Divide memory in half between this two programs? Or place both stacks/heap/static near each others? Or that too specific case that have its own specific rules?
@jonathanmuckell98273 жыл бұрын
@@user-kf1xn1dq9t That's another really good question. There are a couple different parts to the question. The first part relates to whether you have separate threads or processes. Threads share a common memory address space. Two threads tend to have 2 different stacks, but will can share other variables in heap or static memory regions. Processes have completely separate addresses spaces and will have independent stacks, heaps, static memory regions. The OS uses a concept called Virtual Addresses to divide the memory space between different processes. More information on that topic can be found here: en.wikipedia.org/wiki/Virtual_address_space
@fc3fc3549 ай бұрын
But can't you update the value of a static variable?I thought it was impossible to change the value of a static variable
@firedragonmangaming24102 жыл бұрын
Wait im confused. Does malloc return a void pointer ?
@energy-tunes Жыл бұрын
Yes
@user-ui5rx9hg9r3 жыл бұрын
hello
@itsam9417 ай бұрын
sizeof is an operator not a function
@drogeanunicusor7715 Жыл бұрын
sizeof is not a function, it's an operator
@jonathanmuckell9827 Жыл бұрын
Yes, you are correct. Thanks for the clarification. Additional details can be found here: www.geeksforgeeks.org/sizeof-operator-c/
@swedishpsychopath87953 ай бұрын
Explaining this without mentioning the activation record is a waste of time.
@dixztube7 ай бұрын
Use rust lol
@nononnomonohjghdgdshrsrhsjgd2 жыл бұрын
very boring presentation
@osamaragab33252 жыл бұрын
then you are in the wrong place ! you could just don't watch the video, this man is a legend !!