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

preview_player
Показать описание
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,

Learn C programming playlist,

Website link,
Рекомендации по теме
Комментарии
Автор

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.

akhil
Автор

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

raghav
Автор

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

anushaanusha
Автор

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

rajkumarmaity
Автор

helped in preparing for my end sem tomm. thanks!

ishaankulkarni
Автор

Thank you for making my life so much easier!!

jvrs
Автор

Thanks Ma'am for such great explanation 👍

rushikeshpanchal
Автор

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

codewithme
Автор

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

paulg.
Автор

wow
I love your explanation
keep doing it more.

udhayaprakash
Автор

A clean and wonderful explanation mam..

mangolureddemma
Автор

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

chamangupta
Автор

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

takeshiiixD
Автор

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

reneezmp
Автор

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

meenarsrk
Автор

I like this tutorial for C Topic closer than the machine

hfe
Автор

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<stdio.h>
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....

chandureddim
Автор

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?

priyaj
Автор

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.

chandureddim