Call Stack, Scope & Lifetime of Variables

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • Concepts:
    Scope and Lifetime of Variables
    Program Call Stack
    Local and Global Variables

Komentáře • 29

  • @MarijnKonings
    @MarijnKonings Před 11 lety +6

    Thanks for the videos, this deserves way more views.

  • @alfredcalleja450
    @alfredcalleja450 Před 7 lety +2

    This is the best explanation for the memory mechanism I have seen. Thanks!

  • @lizzy487
    @lizzy487 Před 4 lety +1

    It's very helpful! You definitely did a great job on making this concept easy to understand. Thanks!

  • @rbc13183
    @rbc13183 Před 9 lety +6

    Simple and beautiful.....thank you for this.

  • @stylepetrov
    @stylepetrov Před 11 lety

    Brilliant videos, thank you so much.

  • @shainalchetty
    @shainalchetty Před 8 lety +1

    Really well explained! Thank you

  • @Geo63
    @Geo63 Před 8 lety

    Excellent lesson. thank you!

  • @felicienamafin4524
    @felicienamafin4524 Před 3 lety

    Thank you ! now I understand the call stack :)

  • @treasure2387
    @treasure2387 Před 11 lety +1

    Global variables are most of the time constants(const)
    Global variables are destroyed when the program(main) ends.
    Global variables space is allocated on the global memory space(not the stack or heap)
    When a function is called, it's local variables are created on the stack. When the function ends the local variables that are present on the stack frame are removed.

  • @ashwinbhat95
    @ashwinbhat95 Před 8 lety +3

    well explained , cheers!

  • @Adam-gp3ij
    @Adam-gp3ij Před 4 lety

    thank you so much! you helped us

  • @jiamingzhang2989
    @jiamingzhang2989 Před 4 lety

    amazing clear explication

  • @mohammedgawas1276
    @mohammedgawas1276 Před 8 lety +1

    bro i thank u
    it helped me alot

  • @bighomietone195
    @bighomietone195 Před 6 lety +1

    Thanks for the vid

  • @gonzalochristobal
    @gonzalochristobal Před 4 lety

    great video!

  • @koroilesi2017
    @koroilesi2017 Před 8 lety

    well explained...thnx

  • @Shnigi
    @Shnigi Před 7 lety +3

    Very clear explanation, however this didn't explain dynamic and static links in memory allocation =)

  • @Sharm88
    @Sharm88 Před 12 lety

    nice job.

  • @saumyojitdas4212
    @saumyojitdas4212 Před 4 lety

    pi 3.14159 is in the intiliazed data segment area right.
    now when in double areaofCircle r gets ie. 5 gets passed to the pow and in pow function it gets squared and then after squaring does that 25 value goes to the global area space to get multiplied with 3.14 ...as intiliazed data segment area or global space is not in the stack frame.
    how does the access happen between 3.14 and 25 . I am curious to know.??

  • @CrashRebootL3
    @CrashRebootL3 Před 9 lety +1

    ud man, thanks

  • @stokes111111
    @stokes111111 Před 9 lety +1

    incrediblllleee

  • @CSryand2m
    @CSryand2m Před 9 lety

    If you wanted to include queue on this visual representation would stack be split in half, including queue?

    • @dirkdeklerk325
      @dirkdeklerk325 Před 7 lety +1

      You are confusing the the data structure called a stack with stack based memory.

  • @chakradharpogiri7536
    @chakradharpogiri7536 Před 7 lety

    good

  • @willhdq
    @willhdq Před 9 lety +6

    areaOfCircle returns 78.53981634, not 28.5397.

    • @Echoece
      @Echoece Před 4 lety

      Wow he made a typo , what a big crime! Better point that out in CZcams

  • @aravindjoseph6454
    @aravindjoseph6454 Před 7 lety +1

    why no teacher have ever taught me like this

    • @sheldonchen8933
      @sheldonchen8933 Před 5 lety

      Maybe you’ll find it in Class : Program Design Methodology.

  • @aksdjlalsdkls9342
    @aksdjlalsdkls9342 Před 4 lety

    could u just Zoom out rather than moving screen each time.. it rolls my eyes.. :(