Scope of Variables - Local vs Global

  Рет қаралды 391,124

Neso Academy

Neso Academy

6 жыл бұрын

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.org/donate
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy.org/recommende...
Website ► www.nesoacademy.org/
Forum ► forum.nesoacademy.org/
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#CProgrammingByNeso #CProgramming #ScopeOfVariables

Пікірлер: 153
@arpansarkar7924
@arpansarkar7924 5 жыл бұрын
This channel needs more subscriber. Great videos thanks Neso Academy.
@RehanZukhi
@RehanZukhi 3 жыл бұрын
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!
@sathviksan7723
@sathviksan7723 2 жыл бұрын
hows it going now ?
@ayushbaliyan2054
@ayushbaliyan2054 10 ай бұрын
। 😊
@ayushbaliyan2054
@ayushbaliyan2054 10 ай бұрын
। 😊
@ayushbaliyan2054
@ayushbaliyan2054 10 ай бұрын
K.a।।। ।।।। । ।। ।
@vaishnavimendre469
@vaishnavimendre469 4 жыл бұрын
All videos are very great!!! Thank u sir
@astasuleo
@astasuleo 4 жыл бұрын
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.
@chinigepallieswarsaikumar7588
@chinigepallieswarsaikumar7588 4 жыл бұрын
This channel is God fo me in programming as a beginner
@javaexpertsa8947
@javaexpertsa8947 5 жыл бұрын
You explain it so good, i just love this youtube channel, wish i had found it earlier!
@eshikakumari9199
@eshikakumari9199 3 жыл бұрын
Incredible explanation...
@DiyaMehta-kv5xn
@DiyaMehta-kv5xn Ай бұрын
Exactly
@kommsk
@kommsk 2 жыл бұрын
Wonderful...it starts to clear up in my brain all that confusing concepts of why, how... please keep up
@swatikumari6691
@swatikumari6691 3 жыл бұрын
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
@poojaheera7658
@poojaheera7658 3 жыл бұрын
The explanation is just perfect thanks alot sir 🙏
@brijusingh845
@brijusingh845 4 жыл бұрын
Wow... Sir..... Clear crystal !!!! Concept.... God bless you
@dominiquedevries9972
@dominiquedevries9972 4 жыл бұрын
Wow it,s very detailed. Thank you!!!
@parhaimowarson2503
@parhaimowarson2503 Жыл бұрын
Thank you, Neso Academy for your incredible explanation.....
@parthshiroya4436
@parthshiroya4436 4 жыл бұрын
Exactly what i was looking for !!
@dedeepya2611
@dedeepya2611 3 жыл бұрын
Just awesome....easily understandable 🙏
@johnsonmediaprod3239
@johnsonmediaprod3239 3 ай бұрын
This is a question of my class discussion, so you have well explained that and clarified that . Great job
@nagamadiki6313
@nagamadiki6313 3 жыл бұрын
Wow what a explanation... Never before ever after, take a bow🥰
@starman511
@starman511 5 жыл бұрын
Very helpful video, thank you!
@TheFeralEngineer
@TheFeralEngineer 3 жыл бұрын
So glad i found these videos
@shahfaisal7760
@shahfaisal7760 4 жыл бұрын
Thanks A Lot Sir❤️ ...It helped me out 👍
@ridmasathsarani7468
@ridmasathsarani7468 2 жыл бұрын
6 hour lecture content in 11.11 mins. Great work and Thank you!
@programmingwithjavascript3579
@programmingwithjavascript3579 Жыл бұрын
Have you become developer
@learncode6952
@learncode6952 2 жыл бұрын
After searching lots of garbage stuff I found this course was very much helpful
@Aerish369
@Aerish369 Жыл бұрын
Thank you Neso Academy for this informational video.
@alfredchilini5518
@alfredchilini5518 4 жыл бұрын
Neso Academy u r the best in the field good job guys
@jatinrawat7415
@jatinrawat7415 2 жыл бұрын
Just Perfectly Exaplined !!!! Amazing
@jasminesheik3497
@jasminesheik3497 4 жыл бұрын
This vedio deserves lots of likes. The best ever vedio 😊
@suryakilaparthikilaparthi5763
@suryakilaparthikilaparthi5763 3 жыл бұрын
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.
@Jkt61205
@Jkt61205 3 жыл бұрын
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.
@makara2711
@makara2711 3 жыл бұрын
ikr, he's literally the best C programming language teacher i'd ever come across.
@Jkt61205
@Jkt61205 3 жыл бұрын
@@makara2711 yes, it's true
@MarkusEicher70
@MarkusEicher70 3 ай бұрын
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 10 ай бұрын
Greatly thankful sir for your large effort in explaining c language in detailed and depth .
@zandewilson
@zandewilson Жыл бұрын
Very helpful. Thanks
@AbhishekKumar-zw5cd
@AbhishekKumar-zw5cd 5 жыл бұрын
sir mind blowing concept
@Pritamdas-bg7fp
@Pritamdas-bg7fp 6 жыл бұрын
good explanation....thank u sir
@_gp_13
@_gp_13 2 жыл бұрын
Great explanation. Thank you sir.
@sarah3244
@sarah3244 2 жыл бұрын
thank you so much.....for such to the point explanation 👌👌❣️
@bhramastraaa9391
@bhramastraaa9391 Жыл бұрын
Though it wasn't a video fully on functions, but I cleared all my doubts about function.
@saichintada4471
@saichintada4471 3 жыл бұрын
Thank u so much for your understandable and good explanation neso academy 😘😘
@silosizodube4881
@silosizodube4881 2 жыл бұрын
Explanation soo clear
@bmfahim7321
@bmfahim7321 2 жыл бұрын
Great explanation, Thank you
@jarjarbinks9937
@jarjarbinks9937 2 жыл бұрын
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.
@mateuszlukaszczyk5359
@mateuszlukaszczyk5359 3 жыл бұрын
Thanks for the great content.
@paintinginsanes3515
@paintinginsanes3515 2 жыл бұрын
Really great explanation
@sairuthwikbandari9730
@sairuthwikbandari9730 Жыл бұрын
Thanks a lot for neso academy awesome explaination
@kunnudev7250
@kunnudev7250 Жыл бұрын
Great job please continue awesome videos salute to you
@sruthimajhi5610
@sruthimajhi5610 Жыл бұрын
Great one sir!👍🏻
@yuwendridesilva6956
@yuwendridesilva6956 3 жыл бұрын
I donno how the hell I decided to save this playlist on You tube not knowing this is gonna be a GOLDEN playlist.👑👑👑👑👑
@frankmuhiu5059
@frankmuhiu5059 Ай бұрын
Thank you, Sir
@sakaldev4041
@sakaldev4041 3 жыл бұрын
Thanks for this content.
@tarjunrao8823
@tarjunrao8823 2 жыл бұрын
Love of explaination from india
@petronecosmetics9230
@petronecosmetics9230 4 жыл бұрын
Awesome guy.
@harsh9558
@harsh9558 3 жыл бұрын
Sir helped a lot!!
@tayyab.sheikh
@tayyab.sheikh 5 ай бұрын
Pure concepts!
@md_daud
@md_daud 2 жыл бұрын
Thank you!!!
@muhammadmurtaza9247
@muhammadmurtaza9247 2 жыл бұрын
Amazing Explanation
@vakhariyajay2224
@vakhariyajay2224 2 жыл бұрын
Thank you very much. You are a genius. 👍👍🔝🔝
@Therockingww
@Therockingww 3 жыл бұрын
awesome video !!
@AbdulkerimJemal-tc6mn
@AbdulkerimJemal-tc6mn Ай бұрын
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 ????
@javierparrauriostegui1413
@javierparrauriostegui1413 3 жыл бұрын
Great video! New sub!
@mrnaveen6791
@mrnaveen6791 Жыл бұрын
osm explanation....
@gramps717
@gramps717 2 жыл бұрын
very well explained goodddddd for uu
@adithya817
@adithya817 2 жыл бұрын
Best explanation
@sayanstrsc.7272
@sayanstrsc.7272 3 жыл бұрын
? 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?
@porankirajkumar4709
@porankirajkumar4709 3 жыл бұрын
Sir why the function fun() doesn't print the global variable if we don't call the fun in the local variable??
@arjumandvillagecooking
@arjumandvillagecooking 3 жыл бұрын
wonderful👍👍 great🌷
@anshulbaurai664
@anshulbaurai664 4 жыл бұрын
Great video
@naveenkumar-zo1cj
@naveenkumar-zo1cj 10 ай бұрын
Wonderful
@salonisrivastava5527
@salonisrivastava5527 3 жыл бұрын
What an explanation man👍👍 Very nice😊
@Vladimir93459
@Vladimir93459 2 жыл бұрын
Is it enough for placements ?
@narsimhareddy4742
@narsimhareddy4742 3 жыл бұрын
Can anyone explain me last example? int var = 3; is inside int fun(),so how it is called global variable?
@Beatzz555
@Beatzz555 3 жыл бұрын
Thank you sir😌
@natureandtech09
@natureandtech09 2 жыл бұрын
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
@infinitei6539
@infinitei6539 2 жыл бұрын
you told that main function is the starting part of the program and there's another function fun?? please explain
@Aditya-it9jt
@Aditya-it9jt 2 жыл бұрын
Where did i find these notes?
@manumahi4180
@manumahi4180 3 жыл бұрын
When we have to use %d ,and only %d.we are giving here two integers right then what is the difference
@priyanshigarg5728
@priyanshigarg5728 5 жыл бұрын
Sir,, What is the lifetime of a dynamically created variable???
@shashanksrivastava4716
@shashanksrivastava4716 5 жыл бұрын
Sir, Please upload the notes in PDF format on the website.
@gajananand
@gajananand Жыл бұрын
ISO must certify this person is 100% genuine
@namanjain4237
@namanjain4237 2 жыл бұрын
Bhaiya pehle global variable print hoga ya bracket ke andar wala??
@dimplejain7226
@dimplejain7226 6 жыл бұрын
excellent videos!!!! Best teacher ...
@reshma4768
@reshma4768 3 жыл бұрын
Sir, please upload a full course on python programming also
@zakirahimi7924
@zakirahimi7924 3 ай бұрын
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.)
@kammaganisricharan5850
@kammaganisricharan5850 2 жыл бұрын
Tq sir 🙏🙏
@rushabshetty5092
@rushabshetty5092 Жыл бұрын
osm teaching
@joltorongoforssc228
@joltorongoforssc228 2 ай бұрын
Great
@ichaa3tech
@ichaa3tech 4 жыл бұрын
This course is better than all the paid courses
@nitinchinmay260
@nitinchinmay260 2 жыл бұрын
i am getting an error which says '1d returned exit status'
@opst1704
@opst1704 4 жыл бұрын
scope != lifetime just look at static local variable, scope : function lifetime : program runtime
@sreesen3159
@sreesen3159 Жыл бұрын
How to access the global variable in a function which has a variable of the same name as the global variable
@tarikahmad4749
@tarikahmad4749 Жыл бұрын
Where is the lec pdf? Anyone?
@teetole472
@teetole472 Жыл бұрын
Ek dum chakaas👌👌
@RATANAGARWALITINFORMER
@RATANAGARWALITINFORMER 2 жыл бұрын
v helping
@md.mahaburrahmannadim233
@md.mahaburrahmannadim233 2 жыл бұрын
super content
@Vladimir93459
@Vladimir93459 2 жыл бұрын
Is it enough for placements ?
@prateekkubera8922
@prateekkubera8922 2 жыл бұрын
can we get pdf or written notes
@Just-imagine-iff
@Just-imagine-iff 2 жыл бұрын
What's the difference between %d/n and only %d
@logadharani5132
@logadharani5132 4 жыл бұрын
9:17 ...very bull ...lol you're amazing man, I have exams in 3 hours!
@sudev216
@sudev216 3 жыл бұрын
That's what we expect from us Last minute study OP
@sandeepmishra3972
@sandeepmishra3972 4 жыл бұрын
At 10:52..why do we need to call that function [ fun()] in int main function
@kunalk5806
@kunalk5806 3 жыл бұрын
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()
@stephen9673
@stephen9673 2 жыл бұрын
My output was 4 and 4, not 4 and 3. Any explanation of why?
@mummadiamrutha8624
@mummadiamrutha8624 Ай бұрын
%d is nothing but storage of variable and is used to print value in next line
@amarnath8733
@amarnath8733 2 жыл бұрын
1st and 2 nd videos are missing in playlist please add this videos in playlist
@myhumblebeginnings
@myhumblebeginnings 2 жыл бұрын
Is it ok to write like this? int main() { I wonder, because you write it this way: int main() {
@true4189
@true4189 3 жыл бұрын
Thank u
@Vladimir93459
@Vladimir93459 2 жыл бұрын
Is it enough for placements ?
Variable Modifiers − Auto & Extern
12:52
Neso Academy
Рет қаралды 327 М.
What is Scope in Python??
10:25
b001
Рет қаралды 46 М.
That's how money comes into our family
00:14
Mamasoboliha
Рет қаралды 9 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
Local, Global , Static Variables (in C) - Types of variables
14:27
Scope and Local Variables in Java
9:41
Neso Academy
Рет қаралды 83 М.
Variable Modifiers − Static
19:02
Neso Academy
Рет қаралды 240 М.
Call By Value & Call By Reference in C
8:34
Neso Academy
Рет қаралды 1,3 МЛН
C Programming (Important Questions Set 1)
13:42
Neso Academy
Рет қаралды 1,4 МЛН
C++ variable scope explained 🌎
4:23
Bro Code
Рет қаралды 7 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
Variable Scope | C Programming Tutorial
9:49
Portfolio Courses
Рет қаралды 3,5 М.
Special Programs in C − Pyramid of Stars
11:06
Neso Academy
Рет қаралды 849 М.