Pointers and dynamic memory - stack vs heap

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 1K

  • @TheDirk74
    @TheDirk74 2 หลายเดือนก่อน +22

    Watching this in November 2024, and I am amazed by this clear and direct explanation of these memory/pointer concepts. I am in the middle of my journey to finally learn C/C++ at the age of 50, which is a little childhood dream when I wasn't able to wrap my head around this trying to code on my Commodore Amiga in C (and my fallback was Amiga Basic, which was the superslowest approach to coding on this 16 bit computer). So, thank you, unknown creator, I salute you!

  • @mrflamadak6960
    @mrflamadak6960 2 ปีที่แล้ว +128

    You are a man that made 17 minutes feel like 3 and enlightened me every step of the way. I not only salute you, but respect your work immensely. Well done. Subscription more than deserved.

  • @mayorscotch
    @mayorscotch 7 ปีที่แล้ว +40

    I sat through a 2 hour lecture on this subject and this video made far more sense than my professor did. Thank you!

  • @leixun
    @leixun 4 ปีที่แล้ว +210

    *My takeaways:*
    1. Stack 2:12, stackoverflow 5:45
    2. Heap 7:35
    3. Heap is also called dynamic memory, using the heap is referred as dynamic memory allocation 8:56
    4. Heap memory has nothing to do with heap data structure, but stack memory is an implementation of stack data structure 9:17
    5. Dynamic memory allocation functions/operators: C - malloc, calloc, realloc and free. C++ - new and delete 10:00

  • @johnwu89
    @johnwu89 11 ปีที่แล้ว +98

    Very good big picture video, you spent a lot of time prepping of this via examples. Thank you for spending the time to make the forest seem clear and not get lost in the details of the trees

  • @macmadman2008
    @macmadman2008 10 ปีที่แล้ว +625

    Best explanation of memory ever!

    • @theamjolnir9641
      @theamjolnir9641 6 ปีที่แล้ว +4

      Agreed!

    • @PatH902101
      @PatH902101 5 ปีที่แล้ว +6

      I whole heartily agree! Te best explanation of memory usage and the Responsibility of the Programmer to maintain this resource.

    • @nxone9903
      @nxone9903 4 ปีที่แล้ว

      Agreed.

    • @monickverma2944
      @monickverma2944 4 ปีที่แล้ว

      Ikr

    • @vamsikrishnasayarwar1792
      @vamsikrishnasayarwar1792 4 ปีที่แล้ว +1

      Agreed

  • @nickp9910
    @nickp9910 5 ปีที่แล้ว +40

    Always had to deal with stack and heap, and I was unclear of the difference. This explanation and examples were kick-ass. Loved it and it was the best delineation of the stack and heap that I have ever ran into. Thanks much!

  • @theskrript_
    @theskrript_ 5 หลายเดือนก่อน +1

    The best explanation of memory and pointers. Huge, HUGE thanks to this guy. Dude, you did something in that takes 3-5 classes to be explained in 17 minute video. HUGE respect for you, here, take my like!

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +4

    The size of stack is decided during compilation. So, in most cases we do not need to bother about stack-overflow unless we write an infinite or very deep recursion. If we try to use too much of memory on stack and compiler can get to know about it during compile time (like very large arrays in C), it will give you error during compile time. Its just that if compiiler can not predict run-time behaviors like in the case of recursion.

  • @abelashenafi6291
    @abelashenafi6291 2 ปีที่แล้ว +10

    You are amongst the BEST teachers of all TIME. This series of courses has made one hell of an Embedded Systems firmware engineer. I still visit it from time to time. Thanks for sharing this amazing knowledge of yours with a superb explanation ability.

    • @webmaster246
      @webmaster246 2 ปีที่แล้ว

      Some people are meant to be teachers and some don't . We can only accept it and move forward . The sad part, you must pick up a teacher on TH-cam until you find one that make's all demystified - it's time consuming resource :)

    • @swxpizz9338
      @swxpizz9338 ปีที่แล้ว

      Proof ?

    • @losfromla1480
      @losfromla1480 ปีที่แล้ว

      The channel hasn't produced videos in six years! Maybe someone needs to step up and archive it.

    • @swxpizz9338
      @swxpizz9338 ปีที่แล้ว

      @@losfromla1480 ok

    • @suhasvarna2463
      @suhasvarna2463 9 หลายเดือนก่อน

      @@losfromla1480 read about humble fool Harsha Suryanarayana you l know why there are no videos

  • @shekharmaela2308
    @shekharmaela2308 10 ปีที่แล้ว +17

    Thanks for providing subtitles, I know it would hurt your ego to do it, but it really does help. :)

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +9

    It depends on the language, compiler, operating system and architecture. Typically, compilers would know about your local variables and function calls, so they can fix some stack size accounting most of the things except probably things like recursion that may go on infinitely. Once again, OS may also enforce some constraints. So,all in all its a thing of compiler and your system's design.

  • @Wcburg1
    @Wcburg1 6 ปีที่แล้ว +8

    I've never encountered an explanation of this subject that was so easy to understand as well as covering so much material. Thank you infinitely

  • @borisdorofeev5602
    @borisdorofeev5602 2 หลายเดือนก่อน +1

    11 years old, and this is the best explanation of memory allocation I've seen.

  • @jecaman1208
    @jecaman1208 4 ปีที่แล้ว +5

    I see you haven't upload any video recently but I still wanted to thank you. Im a spanish collegue student that strugles to understand his teacher's explanations. Althought english is not my first language, I have found your video an incredible and more helpful explanation than my teachers one. Thank u very much!!!!

    • @craylixart
      @craylixart 3 ปีที่แล้ว

      I heard that he died in a car accident !

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +13

    Hi Ravi,
    Sure. We will do the next video on "character arrays and pointers"

    • @abhashsingh1802
      @abhashsingh1802 3 ปีที่แล้ว +1

      whaaaaaaatttt a mind boggling explanation..... oooommmgggg.

  • @lumigg2556
    @lumigg2556 5 ปีที่แล้ว +19

    Holy shit! none of my actually teachers in school could ever explained like this guy, thanks man!

  • @nirajabcd
    @nirajabcd 2 ปีที่แล้ว +1

    I don't have a formal CS degree. I used to come this channel for the foundation years ago. Love coming back to this channel every once in a while.

  • @GiacomoMiola
    @GiacomoMiola 5 ปีที่แล้ว +282

    I'm in my 2nd year of computer engineering, finally someone tells me that "heap" is NOT the data structure. Thanks a lot

    • @pubdigitalix
      @pubdigitalix 4 ปีที่แล้ว +46

      The heap is a data structure too. Is not the same heap he was talking.

    • @utkarshaggarwal1631
      @utkarshaggarwal1631 3 ปีที่แล้ว +21

      @@pubdigitalix I think that's what he meant.

    • @CUSELİSFAN
      @CUSELİSFAN 3 ปีที่แล้ว +15

      I am self learning computer science. I did not expect the terminology to be this blurry and confusing, since it is called "science".

    • @_Yes_.
      @_Yes_. 3 ปีที่แล้ว +4

      @@CUSELİSFAN lol

    • @_Yes_.
      @_Yes_. 3 ปีที่แล้ว +3

      plz help me im only 15 and i dont understand anything

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +12

    Hi Shri,
    Yeah, we will create more tutorials. Its just that it will take some time. Stay tuned :)

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +30

    Hi Him,
    Ok ! We will try to get one video for object oriented implementation as well.

    • @sayantaniguha8519
      @sayantaniguha8519 4 ปีที่แล้ว +1

      How will the size of the stack be decided by the compiler or working system? Does the decision in anyway, depend upon the code written or entered by the user?

    • @souravmandal2376
      @souravmandal2376 4 ปีที่แล้ว +1

      @@sayantaniguha8519 this legend stoped uploading videos years ago. He is not active so I don't think you are gonna get the answer from him.

    • @sayantaniguha8519
      @sayantaniguha8519 4 ปีที่แล้ว

      @@souravmandal2376 😭😭

    • @tanmaymathur1919
      @tanmaymathur1919 4 ปีที่แล้ว

      @@sayantaniguha8519 He pass passed away 4-5 years ago in a car accident a car ran over her 🙏🏻🙏🏻

    • @nileshgopale8528
      @nileshgopale8528 3 ปีที่แล้ว +3

      @@tanmaymathur1919 For your kind information , he is still alive and working in Google.

  • @pablogarciamolero9608
    @pablogarciamolero9608 2 ปีที่แล้ว +1

    OMG. Thank you for this video, you are an absolute legend.
    It is crazy to think that one is spending thousands of dollars on a higher education degree, and still this 17 minutes FREE video covers the material way better and in a more understanding way than a university lecture.
    This is why I love the Internet and TH-cam. Thank you again, good sir.

    • @pitchthewoo
      @pitchthewoo 2 ปีที่แล้ว

      True, true, and true.

    • @LinkVerse1
      @LinkVerse1 ปีที่แล้ว

      Very true. It is very unfortunate the teacher died a very long ago in an accident.
      R.I.P legend!

  • @LoLei3239
    @LoLei3239 10 ปีที่แล้ว +149

    I wish my university lectures were like this!

    • @swxpizz9338
      @swxpizz9338 ปีที่แล้ว

      Don't care + L + Cry + public static void main args + noob

  • @jpopjr4066
    @jpopjr4066 3 ปีที่แล้ว

    Wow! At 4:06 timeline time; You have clearing established linearity between software programming and physical "RAM" structures. The format, layout, and illustration are brilliant; eight years and months after the year posted. Thank you!
    I paused the video to write this thread. If the remainder of this video continues as noted, it is a great production.

  • @scottdotjazzman
    @scottdotjazzman 8 ปีที่แล้ว +9

    Thank you, THANK YOU, THANK YOU!!! I have struggled with this concept for AGES and your video just made it all click!

  • @byronshilly3923
    @byronshilly3923 11 ปีที่แล้ว

    This tutorial has been more clear than any other resource I have read on this matter, and you have cleared much confusion for me.
    Much thanks.

  • @srishtikumar5544
    @srishtikumar5544 5 ปีที่แล้ว +10

    Wow. This cleared up so much confusion I didn't even know I had! I feel far more solid in my understanding of stack/heap/memory. Thank you!!!

    • @br_i4360
      @br_i4360 ปีที่แล้ว

      Lol I know right? Same feeling I had. "I didn't even know I really didnt understand this until I watched this video" 😅

  • @Jonas.verhaegen
    @Jonas.verhaegen ปีที่แล้ว +1

    For me, such topics should be exactly explained like you have here. Through actual examples of implementation of these concept and a visual representation of what's happening behind the hood. For me a picture does indeed say more than thousand words. Thanks!

  • @studyaccount4009
    @studyaccount4009 4 หลายเดือนก่อน +3

    11 years old video saving my ass today

  • @inc0gnito590
    @inc0gnito590 ปีที่แล้ว +1

    I had spent almost a week trying to understand this concept until I stumbled upon this masterpiece. And this is just too good. The pictorial way of teaching is so much more fun to understand and so much more easier.
    R.I.P humblefool, u will be missed

    • @nitnelavspetorials
      @nitnelavspetorials ปีที่แล้ว

      Bruh don't tell me he's really rip... That will make me sad a bit...

    • @justcallmeRISHI
      @justcallmeRISHI ปีที่แล้ว

      @@nitnelavspetorials Sadly, he was killed in a hit-and-run in 2014 at the age of 30

    • @nitnelavspetorials
      @nitnelavspetorials ปีที่แล้ว

      @@justcallmeRISHI ...Even if it's not what I wanted to hear, maybe it's better for me to know the truth... Thanks mate!

  • @youtube.cmyers
    @youtube.cmyers 10 ปีที่แล้ว +3

    Great lesson, I've watched it many times. Good job.

  • @aweirdguy9785
    @aweirdguy9785 6 ปีที่แล้ว +2

    one of the greatest tutorials ive had in a long time

  • @xanestudio
    @xanestudio 9 ปีที่แล้ว +325

    THose with less time might switch the speed to 1.25x ... His voice is clear enough ... Thnx btw .

    • @BaZoOoKa93
      @BaZoOoKa93 9 ปีที่แล้ว +28

      +Shashank Singh his voice is clear even with 2x

    • @RajatJoshiChannel
      @RajatJoshiChannel 9 ปีที่แล้ว +3

      +Shashank Singh yeah!

    • @maximalgamingnl9954
      @maximalgamingnl9954 7 ปีที่แล้ว

      thx

    • @maximalgamingnl9954
      @maximalgamingnl9954 7 ปีที่แล้ว +2

      1.5 is fine too

    • @infinitesimotel
      @infinitesimotel 6 ปีที่แล้ว +1

      Well done. Much more coherent than the ones I have to speak to for problems with my ISP.

  • @abhimanyumishra9455
    @abhimanyumishra9455 9 ปีที่แล้ว +1

    Sir, you are the best. I have never met a mentor like you in my life. Keep educating the world and may god bless you. Thank You.

  • @lottoman562
    @lottoman562 9 ปีที่แล้ว +30

    I like the subtitles they are helpful

  • @bladerunner2912
    @bladerunner2912 4 ปีที่แล้ว

    Thanks a lot the simplicity with which you explained mall0c and heap , tried 4-5 books and different teachers no one really explained anything thanks a lot

  • @SnowyXx
    @SnowyXx 9 ปีที่แล้ว +11

    Your explanation is excellent thank you :) finally i understand. watched so many videos about this topic and yours was the best

  • @nitnelavspetorials
    @nitnelavspetorials ปีที่แล้ว +1

    4th year student at University, working with higher level languages and not understood these pretty well. I needed to know these even for Java and I got them right this time!!! Thanks!

  • @desmondbrown5508
    @desmondbrown5508 5 ปีที่แล้ว +29

    For english speakers, Heap can be thought of as a pile of data. It was called heap because it piles up data building upwards. The stack builds downwards (hence stack pointer references decreasing addresses as you build onto the stack) while the heap (or pile of data) builds upwards (meaning the addresses increase as you build onto it.

    • @thelonespeaker
      @thelonespeaker 2 ปีที่แล้ว +3

      The drawings make it look like the stack is building upwards, though. This doesn't seem consistent with what you said

    • @Ben-zq7tb
      @Ben-zq7tb หลายเดือนก่อน

      @@thelonespeaker yeah the person who made this video should've done it the other way

  • @andyandrw
    @andyandrw 7 ปีที่แล้ว +1

    You taught pointers in a very effective way among these tutorials, congratulations!

  • @Llyrian2
    @Llyrian2 7 ปีที่แล้ว +3

    This is an amazing break down. I really appreciated it.

  • @duytrinh3367
    @duytrinh3367 2 ปีที่แล้ว

    just book marked this video to comeback and watch in the future, so far the best explanation I can find on youtube

  • @HK-sw3vi
    @HK-sw3vi 4 ปีที่แล้ว +12

    As a cyber-security student, never thought I'd need this and didn't pay attention. well... here I am.

  • @lucasgroves137
    @lucasgroves137 ปีที่แล้ว

    No fluff, just solid content from a teacher who's not in love with the sound of his own voice. 🎯 👍

  • @coldsummersky69
    @coldsummersky69 9 ปีที่แล้ว +312

    hahahaha sweet now i can ask questions on stackoverflow knowing what it was named after. ......... :D

    • @patrasculucian2403
      @patrasculucian2403 7 ปีที่แล้ว +47

      When he said "this is called stack overflow" I got an AHA! moment

    • @edwardjohnson2727
      @edwardjohnson2727 6 ปีที่แล้ว +2

      Lol!

    • @housseinmamadou1585
      @housseinmamadou1585 6 ปีที่แล้ว

      same to me

    • @ShivamJha00
      @ShivamJha00 6 ปีที่แล้ว +1

      Hahahaha

    • @wothin
      @wothin 5 ปีที่แล้ว +3

      @@patrasculucian2403 yes me too. Never thought of that

  • @satyaprakash4598
    @satyaprakash4598 4 ปีที่แล้ว

    Holy place for any beginners .....
    Thanks mycodeschool .......

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +8

    Hi Ravi,
    We have uploaded two videos on "character arrays and pointers". Check the playlist on pointers. Your feedback is appreciated.

  • @umairsaeed5925
    @umairsaeed5925 7 หลายเดือนก่อน +2

    11 years old video still worth it

  • @omkarsuralkar8099
    @omkarsuralkar8099 3 ปีที่แล้ว +3

    Thanx for the information sir. It will be helpfull for me while studying Data Structures and Algorithms

  • @alextsomambet1311
    @alextsomambet1311 6 ปีที่แล้ว

    I started computer science one year ago And I have never understood that, but by wacthing your video I got it in less than 20 min, You have a gift for teaching

  • @parthasarathimishra7538
    @parthasarathimishra7538 3 ปีที่แล้ว +6

    Excellent explanation.
    Just one suggestion that, stack always resides higher then heap. It would be better if you would have drawn stack above the heap. Also stack grown from high to low and heap grown from low to high. These directions are important, and shall be shown.

    • @loganwalker454
      @loganwalker454 3 ปีที่แล้ว +1

      Bro, the instructor is no more among us; however, the zillions people have been taking advantage of his countless effort.

    • @parthasarathimishra7538
      @parthasarathimishra7538 3 ปีที่แล้ว +1

      @@loganwalker454 What happened?

    • @loganwalker454
      @loganwalker454 3 ปีที่แล้ว

      @@parthasarathimishra7538, bro, honorable Harsha Suryanarayana, demised due to a car accident in 2014; however, he is always alive with us.
      th-cam.com/video/wwoYZOjuACE/w-d-xo.html&ab_channel=SubhamPal

    • @parthasarathimishra7538
      @parthasarathimishra7538 3 ปีที่แล้ว

      @@loganwalker454 OMG.... I am extremely sorry to hear about it.
      May God bless his soul.
      I will be deleting my comment.

    • @loganwalker454
      @loganwalker454 3 ปีที่แล้ว

      @@parthasarathimishra7538 bro, your suggestion is also helpful for others. Since I didn't know the stack memory grows from low to high, and the heap memory from high to low.

  • @daveandrewvideos
    @daveandrewvideos 6 ปีที่แล้ว +1

    Have been looking for this for ages! Thanks for a very concise and clear explanation!!!

  • @psn999100
    @psn999100 8 ปีที่แล้ว +3

    For some reason I like his voice than anyone else's. Good tutorial. Tushar Roy's youtube and mycodeschools videos are my goto lecture videos whenever I am preparing for any technical interview.
    THANKS A LOT !

    • @KaushalKumar-js4us
      @KaushalKumar-js4us 8 ปีที่แล้ว

      Good luck Pradosh :)

    • @8802148204
      @8802148204 8 ปีที่แล้ว

      hi!! pradosh and all,these days i am preparing for my technical interviews and i am only watching mycodeschool videos,would u recommend any other lectures or tutorials so that i cover up all the topics of c++, datastructures and programming skills.Tushar roy videos are also good. And thanks to mycodeschool for making such awesome videos, i hope to see more in coming future

    • @psn999100
      @psn999100 8 ปีที่แล้ว +2

      HI Ayush, my suggestion would be to start solving questions from HackerRank and mycodeschool ( the website) first. The main thing that I liked about mycodeschool is that it has many questions relating to implementation of C std libraries, which many interviewers ask.
      HackerRank because most of Amazon questions are direct links to hackerrank, so if you have solved hem in past, you will be in good position.
      Side by side start on leetcode . Leetcode is the goto site for many questions from Google..etc.
      My aim was to solve atleast 5 questions daily.
      Keep a notebook consisting of any solved questions that Tushar does/you do, it will help you a lot during interviews as you can simply go thru the answers from your notebook in a short span of time. During my interviews, i went thru the solved submissions on HackerRank and it helped me a lot .
      You can leave out DP, hard level graph and tree questions for later though. But you should be able to say the tie complexities, and why a particular data structure is used in any question you do.
      Most of my failures in earlier interviews was because I hadnt practised programming. SO evvn though I could tell the algo immediately, on white board I would not give a correct code in 5 minutes. SO ya practice a lot.
      My experience is from being interviewed as a fresh grad from MS in USA. I think in India the question standard are more tough :P
      Lastly , before any interview,,spend some time on glassdoor for that particular company and gp over the questions that people have been asked. That helped me a lot as well.
      Best of luck

  • @mamadookh
    @mamadookh 7 ปีที่แล้ว

    you explained the stack and heap with way better than those instructors of the cs50 course , thanks alot

  • @mpotsengmasetla947
    @mpotsengmasetla947 8 ปีที่แล้ว +503

    while(am still alive)
    {
    printf("%s", "Thank u very much,");
    }

    • @avinashsudhanshu
      @avinashsudhanshu 8 ปีที่แล้ว +68

      you don't need "%s" there!

    • @mpotsengmasetla947
      @mpotsengmasetla947 8 ปีที่แล้ว

      thanks. But it works the same if i remove it(#no difference). Anyway am no longer doing programming.

    • @mpotsengmasetla947
      @mpotsengmasetla947 8 ปีที่แล้ว +5

      @Avinash kumar Shudhanshu, it doesn't matter...... if is not broken don't fix it

    • @juliosanchis
      @juliosanchis 7 ปีที่แล้ว +34

      "am" is not defined

    • @patrasculucian2403
      @patrasculucian2403 7 ปีที่แล้ว +27

      bool stillAlive = 1;
      while(stillAlive != 0){
      printf("Thank you");
      }

  • @Vafiqfreak93
    @Vafiqfreak93 11 ปีที่แล้ว +1

    Fantastic video, I would recommend to anybody having trouble understanding these concepts as they build off each other very well in these videos. Great job, sir.

  • @izaak791
    @izaak791 8 ปีที่แล้ว +61

    i like the pronunciation of "square" -> skwaer

    • @victoza9232
      @victoza9232 7 ปีที่แล้ว +18

      Sounds like "squire"

    • @nands4410
      @nands4410 6 ปีที่แล้ว +5

      squire

    • @MustaWizard
      @MustaWizard 5 ปีที่แล้ว

      couldnt focus because of it

    • @avr4h
      @avr4h 5 ปีที่แล้ว

      I like how you note his pronunciations using structs -> 😉

  • @sujiang5102
    @sujiang5102 7 ปีที่แล้ว

    the best video for memory hierarchy in c/cpp programming I have see. Thank you!

  • @Demitrodon
    @Demitrodon 11 ปีที่แล้ว +134

    That's second indian guy after Rajesh Koothrappali, whom I understand.

    • @nosecandeeznuts
      @nosecandeeznuts 6 ปีที่แล้ว +3

      Whomst'd've's'nd*

    • @ZeeshanJamal23143124324
      @ZeeshanJamal23143124324 6 ปีที่แล้ว

      Koothrappali looks so funny when he laughs.

    • @Sonofpeace
      @Sonofpeace 6 ปีที่แล้ว +3

      how is Rajesh Koothrappali ? give me his youtube channel link broo ~!

    • @mariomiletic22
      @mariomiletic22 5 ปีที่แล้ว

      @@Sonofpeace 0.o

    • @arpitbagri5010
      @arpitbagri5010 5 ปีที่แล้ว

      @@Sonofpeace he is an actor.

  • @shrichede3463
    @shrichede3463 6 ปีที่แล้ว

    probably the best explanation of memory allocation I have heard, great work buddy way to go!

  • @arbylovers
    @arbylovers 10 ปีที่แล้ว +22

    mycodeschool What will happen if the programmer doesn't free the memory after allocating it..Will it stay even after the execution of the program?

    • @mycodeschool
      @mycodeschool  10 ปีที่แล้ว +44

      ARBY No, all the memory is reclaimed once the program finishes execution.

    • @arbylovers
      @arbylovers 10 ปีที่แล้ว

      Ok! Thanks

    • @ThePositiev3x
      @ThePositiev3x 9 ปีที่แล้ว +1

      +mycodeschool are you sure? Because I think my teacher said it is reclaimed only after reboot.

    • @vinidotnet
      @vinidotnet 9 ปีที่แล้ว +19

      +ThePositiev3x
      Once the program finishes, the memory that it was using is freed. Which means that another program can allocate and use them now. But the values that you used before remains as garbage until you reboot or when other program allocates and change it.

    • @mohanaddarwish2307
      @mohanaddarwish2307 9 ปีที่แล้ว +3

      +ThePositiev3x unfortunately mycodeschool stopped replying on his videos of Pointersc/c++ :( all comments and the replies are 11-12 month old xD

  • @starcalibre
    @starcalibre 9 ปีที่แล้ว

    best concise and simple explanation of the stack and heap i've ever seen. thanks.

  • @timiakogun5352
    @timiakogun5352 9 ปีที่แล้ว +4

    he's good

  • @ldulf09
    @ldulf09 8 หลายเดือนก่อน

    This was an incredible explanation and really easy to follow along. Great video!

  • @razvanradoi2139
    @razvanradoi2139 8 ปีที่แล้ว +3

    i love how you say square

  • @alexdoodd
    @alexdoodd 11 ปีที่แล้ว

    I've watched so many of videos about this... You explain it the best.

  • @MaxofWarcraft
    @MaxofWarcraft 8 ปีที่แล้ว +3

    C++ is not a superset of C.

    • @TON-vz3pe
      @TON-vz3pe 2 ปีที่แล้ว +1

      i=i+1; same as i++
      C=C+1; same as c++
      So C++ is a superset of C

  • @gno7553
    @gno7553 4 ปีที่แล้ว +2

    Sans doute la meilleure explication, très pédagogique.

  • @j3llyf15h4
    @j3llyf15h4 8 ปีที่แล้ว +8

    I like the explanation, not a fan of the voice though.

    • @ferds001
      @ferds001 7 ปีที่แล้ว +9

      It's honestly very tolerable, compared to other Indian accents. A lot of programming videos where the tutors who have not only thick accents, but do not enunciate. This guy is really good.

    • @theamjolnir9641
      @theamjolnir9641 6 ปีที่แล้ว

      Just take what you can. This channel is awesome!

    • @tarunmathur7797
      @tarunmathur7797 6 ปีที่แล้ว

      Then just watch with increased playback speed

  • @sarithag3757
    @sarithag3757 3 ปีที่แล้ว

    Master!!! Got to know about your videos very late...But Learnt a lot with your clear Explaination, and gained Clarity of the Topic..Stay Blessed Always!!!

  • @gregtaylor2498
    @gregtaylor2498 11 ปีที่แล้ว

    This content is much easier to understand than what my university provides. Very nice.

  • @animeshnayan1
    @animeshnayan1 11 ปีที่แล้ว +2

    Hi Deep,
    Yes, null character is kept only in character array, not in other types. Moreover, even if you declare block of 20 characters, the size of the array is 20 only, not 19. Its just that you reserve one place for null character. Sometimes your array could be 20 characters long, but string could be only 5 characters long something like "abcde" string in an array C[20]. So here 6th character will be '\0' (null) only to mark the end of string.

  • @samuelmaucaille702
    @samuelmaucaille702 6 ปีที่แล้ว

    Great people who created this channel. Really thankful and I hope you continue with this project someday.

    • @GauravMittal_GM
      @GauravMittal_GM 3 ปีที่แล้ว

      Sad story but the guy in the video died in car accident few years ago and hence this channel is not uploading anything new.

  • @Duckieexpression
    @Duckieexpression 9 ปีที่แล้ว +2

    This gave a really clear explanation. I'm so glad I've found this video! Thank you

  • @ItsFnek
    @ItsFnek 4 ปีที่แล้ว

    You just explained away all questions i had about the reasons to use pointers, why pass by reference is so important and stack vs heap. Thanks dude!

  • @ratmouse088
    @ratmouse088 11 หลายเดือนก่อน

    This is a great video. Just brushing up on some fundamental in prep for job interviews and this was exactly what I was looking for.

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +1

    This is the signature of malloc - void* malloc (size_t size); return type is void* , NULL is not a return type,, its a value. So, value of the void pointer may or may not be NULL. But data-type returned will be void pointer.

  • @MrEyee2
    @MrEyee2 11 ปีที่แล้ว

    You just made one of the most tricky aspects of c/c++ programming trivial... thanks.

  • @chewbaka9664
    @chewbaka9664 ปีที่แล้ว

    This is a great video. Came here to understand what was advertised and even learned more.

  • @nevildadrewalla
    @nevildadrewalla 7 ปีที่แล้ว

    You are a natural teacher and talented... Keep making videos

  • @cyw4662
    @cyw4662 2 ปีที่แล้ว

    Thank you so much. One of the best presentation I have ever watched!

  • @ni3cat
    @ni3cat 2 ปีที่แล้ว

    This is the best explanation I have ever seen. Thank you very much

  • @IsaacAsante17
    @IsaacAsante17 6 ปีที่แล้ว

    Your tutorial is very easy to understand. Great job.

  • @yahuadyews6408
    @yahuadyews6408 4 ปีที่แล้ว

    At first, when I heard an Indian accent, I wanted to leave, but I waited a bit and realized this is the first Indian guy who explains everything very clearly. I am so happy I found this video and watched till the end. Thank you very much!!

    • @CSEPracticals
      @CSEPracticals 4 ปีที่แล้ว

      Those who want to do Operating System coding project on Heap Memory is here :
      www.udemy.com/course/os-project-lmm/?referralCode=300551829F89C8F3E7C2
      Ping me on Whatsapp for discount : +91-9686081839
      All courses in 1 place : www.csepracticals.com/

  • @aungthiha6329
    @aungthiha6329 4 ปีที่แล้ว

    thanks , one of the best videos for dynamic memory allocation I've ever watched about that

  • @Dzikrullah_999
    @Dzikrullah_999 ปีที่แล้ว +1

    such an amazing teacher !

  • @sachinmaurya3259
    @sachinmaurya3259 3 ปีที่แล้ว

    It's been 8 years, but this guys video are the best :)

  • @anhyeuvietnam
    @anhyeuvietnam 11 ปีที่แล้ว

    thank you for the very concise tutorial. you're tutorial actually helped me to finally understand OOP concepts. I find that all the big words and terminologies of OOP are just wrappers to the age old concept of malloc/calloc/realloc/free and typedef struct.

  • @mortenlund1418
    @mortenlund1418 3 ปีที่แล้ว +1

    Thank you over and over again. Best wishes from here.

  • @ankitamukherjee2024
    @ankitamukherjee2024 4 ปีที่แล้ว

    Best explanation of the memory architecture using C. Simple language and with 100 %clarity. Thank you. Subscribed your channel and awaiting for many more such videos. Thanks again!

  • @ZorroRBF
    @ZorroRBF ปีที่แล้ว

    You are a great teacher! I have never understood memory and pointers until now! ❤

  • @DeepSukhwani
    @DeepSukhwani 11 ปีที่แล้ว

    Oh great thanks, good explanation... I was yesterday reading the book Absolute Beginners Guide to C by Greg Perry and that cleared by doubt as well as it said "You always have to reserve enough character array space to hold the longest string you will need to hold, plus the string terminator."

  • @imanesghiouar6480
    @imanesghiouar6480 5 ปีที่แล้ว +2

    the best explanation i had never seen, thank u so much

  • @hnr651
    @hnr651 2 ปีที่แล้ว

    This is still the best intro to C I've ever seen after all these years.

  • @upmboy
    @upmboy 11 ปีที่แล้ว

    That was fantastic and its clear to me as crystal. I have a few ques if you could help me answering them :
    1) how can control when stack overflow happens ?
    2) if I define static memory allocation in my program but still if my program architecture (e.g CUDA C) wants to dynamic memory allocation by default to support it with static memory allocation.
    Thanks

  • @the_mia_mia
    @the_mia_mia 3 ปีที่แล้ว

    Amazing explanation. Thank you!

  • @janingvar
    @janingvar 4 ปีที่แล้ว

    Usually I can't listen to Indian/Pakistani lecturers talk, but this one was very good and well explained! Thank you

  • @KantuEnSilento
    @KantuEnSilento 3 ปีที่แล้ว

    God bless you. Best explanation of the subject I have found.

  • @bryceneil_
    @bryceneil_ 2 ปีที่แล้ว

    Great lesson, best one I have come across so far. Thank you!

  • @gabemvp
    @gabemvp 4 ปีที่แล้ว

    Terrific. Explained the main points in a clear way.