Scope of Variables - Local vs Global

Sdílet
Vložit
  • čas přidán 9. 09. 2024
  • Programming & Data Structures: Scope of Variables in C programming.
    Topics discussed:
    1. What is the scope of a variable?
    2. Local variable.
    3. Example of local variable.
    4. Global variable.
    5. Example of global variable.
    C Programming Lectures: goo.gl/7Eh2SS
    Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
    Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
    Contribute: www.nesoacademy...
    Memberships: bit.ly/2U7YSPI
    Books: www.nesoacademy...
    Website ► www.nesoacademy...
    Forum ► forum.nesoacade...
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    #CProgrammingByNeso #CProgramming #ScopeOfVariables

Komentáře • 154

  • @arpansarkar7924
    @arpansarkar7924 Před 5 lety +49

    This channel needs more subscriber. Great videos thanks Neso Academy.

  • @RehanZukhi
    @RehanZukhi Před 3 lety +81

    Only when i was breakin down everyday because i felt i will fail in c programming, my lecturer shared this playlist, and now i am aiming to excel instead of just passing the test.
    Thanks Neso Academy!

  • @eshikakumari9199
    @eshikakumari9199 Před 3 lety +44

    Incredible explanation...

  • @vaishnavimendre469
    @vaishnavimendre469 Před 5 lety +22

    All videos are very great!!! Thank u sir

  • @chinigepallieswarsaikumar7588

    This channel is God fo me in programming as a beginner

  • @astasuleo
    @astasuleo Před 5 lety +28

    this is the best series of C explaination ever. Please keep it up. Im trying to help this channel by sharing it everywhere i can. I'm a newbie for C in PIC using MPLAB. I wish in the near future, you could be able to have time for making videos based on C in PICs.

  • @jasminesheik3497
    @jasminesheik3497 Před 4 lety +10

    This vedio deserves lots of likes. The best ever vedio 😊

  • @poojaheera7658
    @poojaheera7658 Před 4 lety +10

    The explanation is just perfect thanks alot sir 🙏

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

    You explain it so good, i just love this youtube channel, wish i had found it earlier!

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

    6 hour lecture content in 11.11 mins. Great work and Thank you!

  • @Jkt61205
    @Jkt61205 Před 4 lety +6

    this channel is god for me and all of the persons who are watching these videos,this channel needs at least more than 1 million subscribers,Believe me he teaches EXTRAORDINARILY;he teaches EVERY POINT.THANK YOU SO MUCH SIR.

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

      ikr, he's literally the best C programming language teacher i'd ever come across.

    • @Jkt61205
      @Jkt61205 Před 3 lety

      @@hetaeramancer yes, it's true

  • @kommsk
    @kommsk Před 3 lety +4

    Wonderful...it starts to clear up in my brain all that confusing concepts of why, how... please keep up

  • @nagamadiki6313
    @nagamadiki6313 Před 3 lety +4

    Wow what a explanation...
    Never before ever after, take a bow🥰

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

    Well explained, Clear Concept and too much helpful for those students who are trying to learn c programming.Thank you so much sir for this video

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

    This course is better than all the paid courses

  • @alfredchilini5518
    @alfredchilini5518 Před 5 lety +3

    Neso Academy u r the best in the field good job guys

  • @learncode6952
    @learncode6952 Před 3 lety

    After searching lots of garbage stuff I found this course was very much helpful

  • @bhramastraaa9391
    @bhramastraaa9391 Před rokem +1

    Though it wasn't a video fully on functions, but I cleared all my doubts about function.

  • @parthshiroya4436
    @parthshiroya4436 Před 4 lety +4

    Exactly what i was looking for !!

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

    Wow... Sir..... Clear crystal !!!! Concept.... God bless you

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

    Thanku sir ❤
    you are global variable😊😊.... Cause we all are able to reach you without any offline classes

  • @dominiquedevries9972
    @dominiquedevries9972 Před 4 lety +3

    Wow it,s very detailed.
    Thank you!!!

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

    Thank you, Neso Academy for your incredible explanation.....

  • @yuwendridesilva6956
    @yuwendridesilva6956 Před 3 lety

    I donno how the hell I decided to save this playlist on You tube not knowing this is gonna be a GOLDEN playlist.👑👑👑👑👑

  • @johnsonmediaprod3239
    @johnsonmediaprod3239 Před 5 měsíci

    This is a question of my class discussion, so you have well explained that and clarified that . Great job

  • @salonisrivastava5527
    @salonisrivastava5527 Před 4 lety +3

    What an explanation man👍👍
    Very nice😊

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

    at 6:25 the two variables in the second case have different addresses so that actually makes it two different memory locations. However in the first case can it not be interpreted as changing the variable rather than it's redefinition because when applying a loop, and over multiple iterations the value of the variable might be changing but that isn't interpreted as the redefinition of the function.

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

    Best explanation

  • @shahfaisal7760
    @shahfaisal7760 Před 4 lety +3

    Thanks A Lot Sir❤️ ...It helped me out 👍

  • @tarjunrao8823
    @tarjunrao8823 Před 2 lety

    Love of explaination from india

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

    Thank u so much for your understandable and good explanation neso academy 😘😘

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

    Just awesome....easily understandable 🙏

  • @AbhishekKumar-zw5cd
    @AbhishekKumar-zw5cd Před 5 lety +2

    sir mind blowing concept

  • @Aerish369
    @Aerish369 Před rokem

    Thank you Neso Academy for this informational video.

  • @gajananand
    @gajananand Před rokem

    ISO must certify this person is 100% genuine

  • @MarkusEicher70
    @MarkusEicher70 Před 5 měsíci

    Hello Jaspreet, hi Neso Academy. I highly appreciate your commitment to free education and I am very thankful for your high quality content. I followed the playlist C Programming and Data Structures from the first video on, and it is one of the best, if not the best introduction series I saw till this point. Many thanks and may you be blessed and I wish you much success with finding a way to get compensated for your valuable efforts. I will try to contribute with what ever I can to help keeping this channel alive for learners.

  • @Ashishrajcreations
    @Ashishrajcreations Před rokem

    Greatly thankful sir for your large effort in explaining c language in detailed and depth .

  • @jatinrawat7415
    @jatinrawat7415 Před 2 lety

    Just Perfectly Exaplined !!!! Amazing

  • @teetole472
    @teetole472 Před rokem +1

    Ek dum chakaas👌👌

  • @tayyab.sheikh
    @tayyab.sheikh Před 7 měsíci

    Pure concepts!

  • @zakirahimi7924
    @zakirahimi7924 Před 5 měsíci

    the scope of a variable is not its lifetime. scope is the accessibility or visibility of a variable to other parts of a program. lifetime is the time between the creation of a variable and death of the variable, so a variable may be alive in the program but not accessible. (keep up the great work, your content is very very structured.)

  • @suryakilaparthikilaparthi5763

    Sir, thank you soo much. I am searching for a right video that I could understand. In this process I came through ur video sir with a clear cut explanation. Thank you so much sir.

  • @zandewilson
    @zandewilson Před rokem

    Very helpful. Thanks

  • @frankmuhiu5059
    @frankmuhiu5059 Před 3 měsíci

    Thank you, Sir

  • @TheFeralEngineer
    @TheFeralEngineer Před 3 lety

    So glad i found these videos

  • @sairuthwikbandari9730
    @sairuthwikbandari9730 Před 2 lety

    Thanks a lot for neso academy awesome explaination

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

    scope != lifetime
    just look at static local variable, scope : function
    lifetime : program runtime

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

    osm teaching

  • @dimplejain7226
    @dimplejain7226 Před 6 lety +2

    excellent videos!!!! Best teacher ...

  • @mummadiamrutha8624
    @mummadiamrutha8624 Před 3 měsíci

    %d is nothing but storage of variable and
    is used to print value in next line

  • @silosizodube4881
    @silosizodube4881 Před 2 lety

    Explanation soo clear

  • @gramps717
    @gramps717 Před 2 lety

    very well explained goodddddd for uu

  • @_gp_13
    @_gp_13 Před 2 lety

    Great explanation.
    Thank you sir.

  • @paintinginsanes3515
    @paintinginsanes3515 Před 2 lety

    Really great explanation

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

    Can anyone explain me last example?
    int var = 3; is inside int fun(),so how it is called global variable?

  • @javierparrauriostegui1413

    Great video! New sub!

  • @kunnudev7250
    @kunnudev7250 Před 2 lety

    Great job please continue awesome videos salute to you

  • @vakhariyajay2224
    @vakhariyajay2224 Před 2 lety

    Thank you very much. You are a genius. 👍👍🔝🔝

  • @logadharani5132
    @logadharani5132 Před 4 lety +3

    9:17 ...very bull ...lol
    you're amazing man, I have exams in 3 hours!

    • @sudev216
      @sudev216 Před 3 lety

      That's what we expect from us
      Last minute study OP

  • @md_daud
    @md_daud Před 2 lety

    Thank you!!!

  • @mrnaveen6791
    @mrnaveen6791 Před rokem

    osm explanation....

  • @naveenkumar-zo1cj
    @naveenkumar-zo1cj Před rokem

    Wonderful

  • @sakaldev4041
    @sakaldev4041 Před 3 lety

    Thanks for this content.

  • @kammaganisricharan5850

    Tq sir 🙏🙏

  • @shashanksrivastava4716
    @shashanksrivastava4716 Před 5 lety +2

    Sir, Please upload the notes in PDF format on the website.

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

    Sir, please upload a full course on python programming also

  • @Beatzz555
    @Beatzz555 Před 3 lety

    Thank you sir😌

  • @sruthimajhi5610
    @sruthimajhi5610 Před rokem

    Great one sir!👍🏻

  • @mateuszlukaszczyk5359
    @mateuszlukaszczyk5359 Před 3 lety

    Thanks for the great content.

  • @natureandtech09
    @natureandtech09 Před 2 lety

    Sir you said that if we trying to acess a variable in internal block we can access the contents of outer block also so sir in output question 5:20 why the internal block print 4 as a output as we can see it.can access outerblock var and gives erorr due to redifinition of var because internal block can access outer block information plz explain sir

  • @arjumandvillagecooking

    wonderful👍👍
    great🌷

  • @harsh9558
    @harsh9558 Před 3 lety

    Sir helped a lot!!

  • @shefatabassum5807
    @shefatabassum5807 Před rokem

    Calling a function means we are transferring the control from this to that function

  • @starman511
    @starman511 Před 5 lety

    Very helpful video, thank you!

  • @Just-imagine-iff
    @Just-imagine-iff Před 2 lety +1

    What's the difference between %d/n and only %d

  • @infinitei6539
    @infinitei6539 Před 2 lety

    you told that main function is the starting part of the program and there's another function fun??
    please explain

  • @Pritamdas-bg7fp
    @Pritamdas-bg7fp Před 6 lety

    good explanation....thank u sir

  • @Therockingww
    @Therockingww Před 3 lety

    awesome video !!

  • @joltorongoforssc228
    @joltorongoforssc228 Před 4 měsíci

    Great

  • @anshulbaurai664
    @anshulbaurai664 Před 4 lety

    Great video

  • @RATANAGARWALITINFORMER

    v helping

  • @AbdulkerimJemal-tc6mn
    @AbdulkerimJemal-tc6mn Před 3 měsíci

    The example mentioned in the video says that we cannot enter another var that will make an error but as we learned in itialization of variable that we can change the var and am a little bit confused with it can u explain for Please ????

  • @namanjain4237
    @namanjain4237 Před 2 lety

    Bhaiya pehle global variable print hoga ya bracket ke andar wala??

  • @md.mahaburrahmannadim233

    super content

  • @DSCSNayanakb
    @DSCSNayanakb Před 5 lety +1

    Thank u sir. Pls upload such videoes on java

  • @sayanstrsc.7272
    @sayanstrsc.7272 Před 4 lety

    ? I used to know that a program is executed from the main function. Then how is the variable created before the start of execution of main function?

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

    can we get pdf or written notes

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

    Thanks

  • @sreesen3159
    @sreesen3159 Před rokem

    How to access the global variable in a function which has a variable of the same name as the global variable

  • @manumahi4180
    @manumahi4180 Před 3 lety

    When we have to use %d
    ,and only %d.we are giving here two integers right then what is the difference

  • @cringentertainment2605

    Sir Please make Lecture on C++👏👏

  • @petronecosmetics9230
    @petronecosmetics9230 Před 5 lety +1

    Awesome guy.

  • @priyanshigarg5728
    @priyanshigarg5728 Před 5 lety

    Sir,, What is the lifetime of a dynamically created variable???

  • @amarnath8733
    @amarnath8733 Před 2 lety

    1st and 2 nd videos are missing in playlist please add this videos in playlist

  • @porankirajkumar4709
    @porankirajkumar4709 Před 4 lety

    Sir why the function fun() doesn't print the global variable if we don't call the fun in the local variable??

  • @true4189
    @true4189 Před 4 lety

    Thank u

  • @rakesh_007
    @rakesh_007 Před 4 lety

    Please put the captions

  • @sandeepmishra3972
    @sandeepmishra3972 Před 5 lety +1

    At 10:52..why do we need to call that function [ fun()] in int main function

    • @kunalk5806
      @kunalk5806 Před 3 lety

      so why we are calling the function fun() in int main function is that because the function fun() outside the int main function gets executed..Thats why it prints output 10 in fun()

  • @myhumblebeginnings
    @myhumblebeginnings Před 2 lety

    Is it ok to write like this?
    int main()
    {
    I wonder, because you write it this way:
    int main() {

  • @sampath1215
    @sampath1215 Před 5 lety +1

    please add Computer organization videos also.