Variable Modifiers − Auto & Extern

  Рет қаралды 329,737

Neso Academy

Neso Academy

6 жыл бұрын

Programming & Data Structures: Auto and extern variable modifiers in C programming.
Topics discussed:
1. Auto modifier.
2. Extern modifier.
3. Extern modifier examples.
4. Procedure to create a project and different files within that project.
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 #VariableModifiers

Пікірлер: 203
@arundhutimukherjee1412
@arundhutimukherjee1412 3 жыл бұрын
When I will pass college and get a job I will donate to Neso academy from my first salary. Thank you for your priceless efforts.
@shashinegative9366
@shashinegative9366 2 жыл бұрын
They don't need they have enough now..
@user-vp1gv4hp1o
@user-vp1gv4hp1o 9 ай бұрын
good idea @@shashinegative9366
@tufandas9065
@tufandas9065 8 ай бұрын
hi where are you from??
@opgamerz877
@opgamerz877 Ай бұрын
You'll forget bro
@brewedscript1014
@brewedscript1014 4 жыл бұрын
i love these lessons. It explains everything that I need to know in coding.
@vandarkholme442
@vandarkholme442 3 жыл бұрын
clear and straightforward, better than my professor
@Ribulose15diphosphat
@Ribulose15diphosphat 6 ай бұрын
And Wrong: 1. auto is the opposite of register. Declaring a variable as auto, prevents compiler-optimisation to turn it into a register-variable. Typically you want register-variables in inner loop, but declare variables of the outer loop first, so delare the variables for the outer loop as auto. 2. Global variables are not initialized to zero. If your system/compiler does that - nice - but the C-standards says there is garbage.
@bhaweshsharma275
@bhaweshsharma275 2 жыл бұрын
I'm actually getting better in C and also in DSA with this course. ❣❤💛🧡
@nataliab.9725
@nataliab.9725 2 жыл бұрын
I am so glad I found this channel, I have been struggling to learn C for 2 years and now I'm finally understanding it! Thank you so so much!
@aniketdas451
@aniketdas451 3 жыл бұрын
honestly, this channel needs more and ultimate support. thank you, sir.
@gauravkumeriya376
@gauravkumeriya376 3 жыл бұрын
such a clear explaination ...thats the reason i always loved neso academy
@Jeremyak
@Jeremyak 2 ай бұрын
These lessons are a cut above the typical tutorial fare, these go slightly deeper into the mechanics of the language and I very much appreciate that. 👍
@MohitK96
@MohitK96 5 жыл бұрын
I was taught C language just to pass exam in first year in my coaching, though college teachers came occasionally... Now, I came to this tutorial, I already did DE tutorials from Neso, amazed to know so many things, wished Neso had uploaded it earlier...
@mohammedabood9877
@mohammedabood9877 Жыл бұрын
what an amazing and smooth way of explaining, thank you so much for your effort
@user-je3jj6fu7y
@user-je3jj6fu7y 2 жыл бұрын
I'm the student from taiwan , this lesson help me a lot in learning c , Just keep going , you already change the way the cs student around the world how to study. Thank you !!!!
@akshatnitnaware9940
@akshatnitnaware9940 5 жыл бұрын
Really good Explanations, god bless you!
@nikhilagrawal9217
@nikhilagrawal9217 5 жыл бұрын
Thank you so much for making this video. It was worth seeing this video 😀😃
@nisargsheth9841
@nisargsheth9841 4 жыл бұрын
Thank you very much. simple and crisp lecture.
@galnadjar
@galnadjar 3 жыл бұрын
simply precise and clear. thank you so much !
@astasuleo
@astasuleo 4 жыл бұрын
amazing thanks so much for these lessons.
@UniversalSaad
@UniversalSaad 2 жыл бұрын
My exam is knocking at the door. Your lecture keeping me fight like a survivor. Thanks a lot, sir. All my respect for you. ♥
@sadiashafaque3517
@sadiashafaque3517 3 жыл бұрын
Beautifully explained, thanks alot!
@MikeOchtman
@MikeOchtman 2 жыл бұрын
Very clear description. Thank you very much!
@shreyajha7097
@shreyajha7097 3 жыл бұрын
Thank you so much for making such videos. These are very helpful and easy to understand 😊😊
@rashidshah277
@rashidshah277 6 жыл бұрын
Excellent way of Teaching !!!
@SHASHANKRUSTAGII
@SHASHANKRUSTAGII 3 жыл бұрын
helpful. Thanks NESO, I love you guys
@dipeshsamrawat7957
@dipeshsamrawat7957 3 жыл бұрын
Thank you so much, I will never forget you. Thank you so much again and again. ☺️☺️☺️❤️❤️❤️❤️🙏
@Pilgrim182
@Pilgrim182 3 жыл бұрын
Very clear explanation Sir, thank you.
@OAOOHarikesavareddy
@OAOOHarikesavareddy 3 жыл бұрын
best course ever...i loved it
@ashokkoli9977
@ashokkoli9977 2 жыл бұрын
You definitely deserve more subscribers!!🙌
@mauryaashish1865
@mauryaashish1865 3 жыл бұрын
Awesome explanation!!
@saiprasadjetti2175
@saiprasadjetti2175 4 жыл бұрын
Excellent lecture
@prabhatatha8968
@prabhatatha8968 4 жыл бұрын
Awesome tutorial to learn c programming
@agamgill9563
@agamgill9563 6 жыл бұрын
informative lecture....thanx sr...
@sruthimajhi5610
@sruthimajhi5610 Жыл бұрын
Great one sir!
@MJ-dq8om
@MJ-dq8om 3 жыл бұрын
at 1:43 , I haven't initialized a variable in main function and by printing that variable,it gave me as 0 but not a garbage value.
@Official-tk3nc
@Official-tk3nc 4 жыл бұрын
Guys they are providing everything for free and some idots dislikes these types of videos. I think they need mental treatment
@sagnikpoddar881
@sagnikpoddar881 4 жыл бұрын
they are unaceademy employess
@Leo-qr1rq
@Leo-qr1rq 3 жыл бұрын
Chill bro it's bot,which was programmed by KZbin
@corsicanbread7276
@corsicanbread7276 3 жыл бұрын
They probably got mad they couldn’t figure it out or something
@mateuszlukaszczyk5359
@mateuszlukaszczyk5359 3 жыл бұрын
Thanks for the great content.
@oggy107
@oggy107 3 жыл бұрын
Best one you can get😍
@prasadsawant9122
@prasadsawant9122 3 жыл бұрын
Thanks for sharing so many small small details , not only for this topic but all topics in all of your videos ... I do have one question here for extern What if we declare int a = something in two different files and try to refer in our main file using extern ..which one it will refer?
@mukulmalviya1605
@mukulmalviya1605 3 жыл бұрын
use of uninitialized local variables leads to undefined behaviour. It depends on the compiler, in the visual studio community if we print the value of uninitialized variable it gives compile-time error while in GCC compiler it prints 0
@deepayanbiswas4488
@deepayanbiswas4488 3 жыл бұрын
Very good tutorial, tysm.
@snitabongale7823
@snitabongale7823 8 ай бұрын
Very helpful video
@sharau.99
@sharau.99 4 жыл бұрын
You are excellent !!!
@Jkt61205
@Jkt61205 3 жыл бұрын
JUST AMAZING!!
@zizomohamed9015
@zizomohamed9015 Жыл бұрын
Thank you for a wonderful video and a great explanation.
@csharpdev-software-engineer
@csharpdev-software-engineer 3 жыл бұрын
👍👍👍 thanks for good tutorial!
@akritibhan5858
@akritibhan5858 3 жыл бұрын
simply awesomeeeee.....
@atharvanaik2434
@atharvanaik2434 3 жыл бұрын
GCC didn't compile program with auto keyword. It throws error:two or more data types in declaration of 'var'. While, cl(MSVC) printed 0.
@vakhariyajay2224
@vakhariyajay2224 2 жыл бұрын
Thank you very much. You are a genius. 👍👍🔝🔝
@md_daud
@md_daud 2 жыл бұрын
Thank you ❤️
@saiprasadjetti2175
@saiprasadjetti2175 4 жыл бұрын
Nice explanation
@panthasaleheen4952
@panthasaleheen4952 4 жыл бұрын
What I think is, the extern variable works like the complement set. 'A' complement is equal to universal set minus 'A' set.
@cloudproblemssolved
@cloudproblemssolved Ай бұрын
amazing
@krutarthpatel6537
@krutarthpatel6537 3 жыл бұрын
Very nice video 🔥🔥
@anandkumarsinghCS
@anandkumarsinghCS 3 жыл бұрын
Yes after paying on, you will have not too much better tutorial 👍👍👍👍
@hibmoshar6206
@hibmoshar6206 4 ай бұрын
thanks alot
@TheFactsThatShowYouWise
@TheFactsThatShowYouWise 2 жыл бұрын
your expletation is quite magnificent
@balajishanmugavel1861
@balajishanmugavel1861 3 жыл бұрын
Thanks neso academy
@himanshuyadav1712
@himanshuyadav1712 2 жыл бұрын
Thanku you sir. 🙏🙏🙏🙏🙏🙏
@techbeginners3816
@techbeginners3816 3 жыл бұрын
1:44 sir what is garbage value and how it is printed?
@avitiwari7921
@avitiwari7921 2 жыл бұрын
Good Explanation What if there are multiple files with int a declaration and defination and a single extern int a in main file? If memory is not provided to extern int a, so when does the exact value and memory for variable a is filled?
@cucuccucuc3744
@cucuccucuc3744 2 жыл бұрын
These lectures are just costless
@vikassaini1935
@vikassaini1935 3 жыл бұрын
this is gold
@akshadrathod9203
@akshadrathod9203 Жыл бұрын
nice one
@shubhampawar.7776
@shubhampawar.7776 3 жыл бұрын
Masterpiece
@sudipkumarmondal136
@sudipkumarmondal136 3 жыл бұрын
Sir, in my computer auto variable does not give garbage values it also initializes with 0 as same as global variable.
@himanshichoudhary8778
@himanshichoudhary8778 3 жыл бұрын
Thanks
@true4189
@true4189 3 жыл бұрын
Thank u
@pragyapatel7335
@pragyapatel7335 5 жыл бұрын
Does the memory of extern variable destroyed when the program done executing?
@_MostofaShariarSanim_B
@_MostofaShariarSanim_B 3 жыл бұрын
To be honest , this course is better than some paid course.
@namitasharma5201
@namitasharma5201 4 жыл бұрын
can't thank you enough
@sriharsha8802
@sriharsha8802 4 жыл бұрын
sir I had tried to print output for an integer(not initialized) but instead of printing any random garbage value it prints 0 all the time. why this happens ?
@Dontever_throw_trash_out
@Dontever_throw_trash_out 5 жыл бұрын
can anyone tell what extern int function will assign its value when the whole operation is performed in any online compilers or any other online compiler
@ojasvvgupta5639
@ojasvvgupta5639 3 жыл бұрын
at 9.52 even if we dont write extern in main then also it will print 9 as we have already defined the global variable then why to use extern.
@jayasmitade7474
@jayasmitade7474 2 жыл бұрын
Short and to the point videos, finally I found the course I needed. Thank you so much for all your effort. _/\_
@shashankmishra5329
@shashankmishra5329 5 жыл бұрын
Complete c please neso!
@karthikbankapur3520
@karthikbankapur3520 5 жыл бұрын
sir I had tried to print output for an integer(not initialized) but instead of printing any random garbage value it prints 0 all the time. why so?
@vineetverma6645
@vineetverma6645 4 жыл бұрын
was it global?
@riturajpathak1905
@riturajpathak1905 4 жыл бұрын
same and it was not global
@princedhiman8714
@princedhiman8714 3 жыл бұрын
@@riturajpathak1905varies according to machine properties
@gauravkumeriya376
@gauravkumeriya376 3 жыл бұрын
@@riturajpathak1905 ya but it is unpredictible in latest version of gcc. see geeks for geeks
@parsikarudhirbabu9462
@parsikarudhirbabu9462 3 жыл бұрын
it happened for me too
@Sabari-gd3fw
@Sabari-gd3fw Жыл бұрын
Hi sir, Thanks for this useful content. I have one query in this , at 10:03 you told if extern variable don't have definition in current file, it will go and search other files to retrieve the definition..my question here is which file it takes first to search the definition of this extern variable...because in your case you have created only one "other.c" file...but in reality there are lot of files will be there.If I am varying that extern variables in multiple files which file definition it will consider first?
@syedhazim9957
@syedhazim9957 3 жыл бұрын
what will happen if there are multiple files that have defined variable 'a' Which file's value of a will the compiler access?
@krut4rth
@krut4rth 4 ай бұрын
@2:35 int var; // It is just declared, not defined.. // definition is when you assign memory to it with = operator
@Zer0_byte
@Zer0_byte 7 ай бұрын
dear sir i try it what i notice is when i auto char auto float is value is expect 0 also unsigned int
@ashishsinha8893
@ashishsinha8893 6 жыл бұрын
sir plz upload videos all as soon as possible my examination is near about placement interviews.... plz sir if possible
@yagneshacharya2461
@yagneshacharya2461 2 жыл бұрын
what if we create more than 2 files like i created 3 files and declaring int a = 2 and int a = 3 , and then i write extern int a in my 1st file , so when i write printf(a) what will print?
@sharadraj338
@sharadraj338 4 жыл бұрын
tried to initialise an exten variable which already existed in other file, it throws error as -->>" [Error] 'a' has both 'extern' and initializer " always ? please explain sir !
@shiprajha8304
@shiprajha8304 3 жыл бұрын
when i keep the variable global and uninitialized, its showing compilation error and for local variable (not initialized) its showing 0 and not garbage value....why is that?
@anupriyarani6902
@anupriyarani6902 3 жыл бұрын
Sir then What is the use of auto modifier ,if it doesn't change anything in program.
@RiseAayush
@RiseAayush 2 жыл бұрын
The output when i use var in form of global variable as well as in the scope gives the output as same as 0. What would be the reason behind it????????
@vijayanks1714
@vijayanks1714 3 жыл бұрын
What compiler u have use sir...
@mahdarif4957
@mahdarif4957 2 жыл бұрын
if I have multiple files with in a project and all the files have same variable with different definition, which value will the extern int takes??
@frezajoe5836
@frezajoe5836 2 жыл бұрын
now, what is the pros of external keyword, if we can just include one file in another in order to access his declared globale variable instead of those geeky flashy gamic extern keyword?
@shrutimishra9809
@shrutimishra9809 3 жыл бұрын
Please anyone tell me,are these lectures are enogh for gate 22 ..please.
@tejaschitnis154
@tejaschitnis154 3 жыл бұрын
can a linker assign a value from another project file? is there any such case? why not?
@thestoicway001
@thestoicway001 3 жыл бұрын
Sir my local variable is also returning 0 all time
@MK-or5zl
@MK-or5zl Жыл бұрын
What if i multiple files are created and each of then having same var name and different values
@currentxchange
@currentxchange 3 жыл бұрын
When using another compiler (gpp in atom) it didn't work at all. Perhaps no linker? Undefined symbols for architecture x86_64: "_dd", referenced from: _main in main-f1adc3.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
@chiragchirag4649
@chiragchirag4649 8 күн бұрын
Will these concepts of system level features be used in other programing language like python?????????
@omkumarsingh4194
@omkumarsingh4194 3 жыл бұрын
If I define variable int a =3; inside some function say func() then , I write extern int a; in main() and printf ("%d",a); Whether it will show 3 or error.
@abhaypratap9898
@abhaypratap9898 3 жыл бұрын
Error
@dachinoloko7624
@dachinoloko7624 3 жыл бұрын
Hi thanks for the lessons I appreciate it very much. However, I have a question. I tried not intializing my variable with int var; and also with auto int var; where both are actually the same in the local scope. The result I obtained was zero instead of indeterminate/random/garbage value. Why is that so? This means the int var; in local is the same as if I declare it globally since int var; in global is always zero. Thank you and hope to hear your explanation when you're free. Cheers!
@Daisy-xs9yb
@Daisy-xs9yb 2 жыл бұрын
int var in local getting zero is not the same as int var in global because when you declare a global variable the initial or the default value is zero but a local variable stores a random number so if you get a local variable equal zero then it is just a coincidence maybe if u give local int var another time it will give a diff ans. hope it helps
@bogichandu1217
@bogichandu1217 6 жыл бұрын
Sir I want multivibrators pls put the link
@sonusambharwal8828
@sonusambharwal8828 4 жыл бұрын
Super sir
@sonusambharwal8828
@sonusambharwal8828 4 жыл бұрын
Sir,Dynamic Memory Allocation{malloc,calloc,realloc} storage classes etc... Par bhi video upload kijiye... because your teaching style and explanation manner outstanding....I wiated for these lectures...
@sayanmondal1387
@sayanmondal1387 2 жыл бұрын
sir extern int a; doesn't work in my code blocks what should I do? my main.c #include extern int a; int main() { printf("%d", a); return 0; } and my other.c int a = 56;
@ProProgrammer-ss4gb
@ProProgrammer-ss4gb 3 ай бұрын
Are the notes of these lectures available somewhere...? And how can i access them...?
@adithyagalipelli2934
@adithyagalipelli2934 3 жыл бұрын
can't we use extern modifier inside the main function?
Variable Modifiers − Register
4:02
Neso Academy
Рет қаралды 202 М.
Scope of Variables - Local vs Global
11:12
Neso Academy
Рет қаралды 394 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 86 МЛН
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Chapitosiki
Рет қаралды 3,3 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 9 МЛН
Variable Modifiers − Static
19:02
Neso Academy
Рет қаралды 241 М.
Auto Storage class explanation with best examples | C Programming
16:22
Header Issues: Guards, Name Mangling, and extern "C"
8:32
Jacob Sorber
Рет қаралды 76 М.
Constants in C (Part 1)
8:43
Neso Academy
Рет қаралды 252 М.
Understanding the Extern Keyword in C
3:17
Jacob Sorber
Рет қаралды 73 М.
Static and Dynamic Scoping (Part-1)
11:34
Neso Academy
Рет қаралды 251 М.
Logical Operators in C
12:09
Neso Academy
Рет қаралды 411 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН