Video není dostupné.
Omlouváme se.
Local, Global , Static Variables (in C) - Types of variables
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/
My all doubts about variables got clarified . Thanks a lot mam
My doubts on type of a variable are cleared.Thanks a lot ma'am
Thanks a lot, best explanation so far for me personally!
Dear Ma'am, thanks a lot for such a concise and neat explanation. Believe me, your tutorials are just 24 karat gold.
helped in preparing for my end sem tomm. thanks!
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.
Thank you for making my life so much easier!!
Thanks Ma'am for such great explanation 👍
Thank you...very clear explanation 👍🏻👍🏻
Very well explained. Thanks a lot!!! =D
A clean and wonderful explanation mam..
Thank you so much, that was a very precise explanation =)
wow !!!!!!!!!!!!
I love your explanation
keep doing it more.
Really well explained Thanks a lot
Awesome explanation.
Nice explaination !!
Thanks 🙏🏻
thanks a lot......
I like this tutorial for C Topic closer than the machine
good explaination
thanks , ur voice seems like the railway station announcement !!
Very helpful
Thank u mam
Best !
Nicely explained....Thank you!!!Can you also factor in extern KEYWORD to this. Thanks again!!!
Thanx mam from tamil channel ❤️
Super
Nice mam
NYC mam😊
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?
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
@@logicfirst31 thank u ma'am 🤩
Bestt
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....
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.
Yes when ever you create a {} a new stack is created and treats as new variable
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.
no no. it only happens when you compile.
@@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.
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.
@@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.
ok chandu i will give a try
its too complecated.