Video není dostupné.
Omlouváme se.

Local, Global , Static Variables (in C) - Types of variables

Sdílet
Vložit
  • čas přidán 16. 09. 2019
  • Scope and memory management for local, global and static variables is discussed in detail with examples.
    - What are local variables? What is the scope of local variables?
    How local variables are allocated in memory? How local variables occupy the stack frames within the stack segment of RAM? Can you have two local variables with same name in two different functions?
    - What are global variables? How they are managed in memory? Storing of global variables in data segment of RAM. Global and static variables initialized to zero.
    - What are static variables? How are they stored in memory?
    Program links,
    Mastering loops playlist,
    • Mastering loops
    Learn C programming playlist,
    • Learn C programming
    Website link,
    logicfirstcoding.com/

Komentáře • 44

  • @anushaanusha426
    @anushaanusha426 Před 3 lety +3

    My all doubts about variables got clarified . Thanks a lot mam

  • @rajkumarmaity1243
    @rajkumarmaity1243 Před 3 lety +3

    My doubts on type of a variable are cleared.Thanks a lot ma'am

  • @paulg.3067
    @paulg.3067 Před 3 lety +1

    Thanks a lot, best explanation so far for me personally!

  • @raghav5074
    @raghav5074 Před 3 lety +3

    Dear Ma'am, thanks a lot for such a concise and neat explanation. Believe me, your tutorials are just 24 karat gold.

  • @ishaankulkarni49
    @ishaankulkarni49 Před 3 lety +2

    helped in preparing for my end sem tomm. thanks!

  • @akhil2721
    @akhil2721 Před rokem

    Mam you are life saver , I am learning c from past 4 months but was not aware with such basic concepts ,thanks for such a wonderful explanation you are truly a gem of teaching.

  • @jvrs9070
    @jvrs9070 Před 2 lety +1

    Thank you for making my life so much easier!!

  • @rushikeshpanchal1349
    @rushikeshpanchal1349 Před 2 lety +2

    Thanks Ma'am for such great explanation 👍

  • @codewithme2746
    @codewithme2746 Před 3 lety +1

    Thank you...very clear explanation 👍🏻👍🏻

  • @takeshiiixD
    @takeshiiixD Před 3 lety +2

    Very well explained. Thanks a lot!!! =D

  • @mangolureddemma3301
    @mangolureddemma3301 Před 3 lety +1

    A clean and wonderful explanation mam..

  • @reneezmp
    @reneezmp Před 2 lety

    Thank you so much, that was a very precise explanation =)

  • @udhayaprakash7833
    @udhayaprakash7833 Před 3 lety +1

    wow !!!!!!!!!!!!
    I love your explanation
    keep doing it more.

  • @Vibrant_Gna
    @Vibrant_Gna Před 3 lety +1

    Really well explained Thanks a lot

  • @tayyabjatoi8644
    @tayyabjatoi8644 Před 4 lety +2

    Awesome explanation.

  • @ShreyaSingh-vr9qi
    @ShreyaSingh-vr9qi Před 4 lety +2

    Nice explaination !!

  • @vikramreddy5631
    @vikramreddy5631 Před rokem

    Thanks 🙏🏻

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

    thanks a lot......

  • @hfe1833
    @hfe1833 Před 3 lety

    I like this tutorial for C Topic closer than the machine

  • @omarkhaled-vy8tq
    @omarkhaled-vy8tq Před 4 lety +1

    good explaination

  • @chamangupta4624
    @chamangupta4624 Před 3 lety +1

    thanks , ur voice seems like the railway station announcement !!

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

    Very helpful

  • @narasimhapalla3529
    @narasimhapalla3529 Před 2 lety +2

    Thank u mam

  • @cr7johnChan
    @cr7johnChan Před 3 lety +2

    Best !

  • @meenarsrk6450
    @meenarsrk6450 Před 2 lety

    Nicely explained....Thank you!!!Can you also factor in extern KEYWORD to this. Thanks again!!!

  • @romanking8017
    @romanking8017 Před 2 lety +2

    Thanx mam from tamil channel ❤️

  • @rushitambe6874
    @rushitambe6874 Před 2 lety

    Super

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

    Nice mam

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

    NYC mam😊

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

    Mam when the memory will allocate for static variables which is declared inside some function.and when memory allocates for local variable? Is it compile time or runtime?

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

      memory allocation is a little complicated. compiler allocates virtual memory in both cases but the real allocation takes place only run time for everything. you can chk accepted answer here to know what compile time allocation really means stackoverflow.com/questions/21350478/what-does-memory-allocated-at-compile-time-really-mean#21350570

    • @priyaj9908
      @priyaj9908 Před 4 lety

      @@logicfirst31 thank u ma'am 🤩

  • @user-hw1gf6mr7b
    @user-hw1gf6mr7b Před 3 měsíci

    Bestt

  • @chandureddim4327
    @chandureddim4327 Před 3 lety +2

    mam, i have another doubt mam that.
    if we create a another scope within a scope does another stack is created as it is not accessible to outer scope
    #include
    int main( )
    {
    int a=10;
    {
    int b=190;
    //here we can access variable a mam.
    }
    printf("%d",b); //error
    //but why cant we access variable b here ..does scope within a scope leads to creation of another stack mam ?
    }
    thanks in advance mam....

    • @logicfirst31
      @logicfirst31  Před 3 lety +3

      Great question chandu. I am honestly not sure about this as none of the materials or books i refer never talk about this. Memory management gets much complicated if you dig deeper. The video is just a bird's eye view.

    • @vikramreddy5631
      @vikramreddy5631 Před rokem

      Yes when ever you create a {} a new stack is created and treats as new variable

  • @chandureddim4327
    @chandureddim4327 Před 3 lety

    mam, i have a doubt that
    do memory is allocated for local variables while writing code ?
    int main ( )
    {
    int a;
    a=10;
    /* does while writing this line do memory is created for a mam ?
    thanks in advance waiting for ur reply mam.

    • @logicfirst31
      @logicfirst31  Před 3 lety

      no no. it only happens when you compile.

    • @chandureddim4327
      @chandureddim4327 Před 3 lety

      @@logicfirst31 if u dont mind , i want to mention one point mam that please take a complex problem and do memory representation to it mam from compilation to running it what happens to it make a clear explanation to it mam.thank you mam.

    • @logicfirst31
      @logicfirst31  Před 3 lety

      It sounds interesting but I am not qualified enough for that. Because as i programmer I think this level of understanding is sufficient. what you are saying is the job the person who is coding the programming language itself.

    • @chandureddim4327
      @chandureddim4327 Před 3 lety

      @@logicfirst31 i just asked u because i thought that u r the one stackoverflow (id -manu ) answered the question in the given below link mam. (i got to this assumption because u posted this link on priya j 's reply in this video mam) stackoverflow.com/questions/21350478/what-does-memory-allocated-at-compile-time-really-mean#21350570
      when i gone through those answers i got to know that address will be there in stack but u said in video as values will be there ,so bit very confused and asked u to do a video on it mam.please make video on it mam. i believe u can please make a try mam. please! it would be very useful mam.

    • @logicfirst31
      @logicfirst31  Před 3 lety

      ok chandu i will give a try

  • @prince10oct
    @prince10oct Před 4 lety

    its too complecated.