filmov
tv
Static keyword in c language | #27 C Programming tutorial in HINDI

Показать описание
Welcome to Tech Talk Tricks and in this video, we will learn about static keyword with example in c language.So stay tuned and watch what is static keyword and what is the syntax to use static keyword storage class in c language.
My Gadgets :
#RanaSingh #TechTalkTricks #static #clanguage #cprogramming #clanguage
In the C programming language, static is used with global variables and functions to set their scope to the containing file. In local variables, static is used to store the variable in the statically allocated memory instead of the automatically allocated memory.
Static Variables in C
Static variables have a property of preserving their value even after they are out of their scope!Hence, static variables preserve their previous value in their previous scope and are not initialized again in the new scope.
Syntax:
static data_type var_name = var_value;
Following are some interesting facts about static variables in C.
1) A static int variable remains in memory while the program is running. A normal or auto variable is destroyed when a function call where the variable was declared is over.
For example, we can use static int to count number of times a function is called, but an auto variable can’t be sued for this purpose.
For example below program prints “1 2”
int fun()
{
static int count = 0;
count++;
return count;
}
int main()
{
printf("%d ", fun());
printf("%d ", fun());
return 0;
}
At Tech Talk Tricks you will learn HTML, CSS, SQL, PL/SQL, JAVA and many more computer as well as mobile tips and tricks.
So please SUBSCRIBE to getting updated with the latest technology.
static variable in c++,
static global variable in c,
static function in c,
static variable vs global variable,
register variable in c,
static variable,
difference between static local and static global variable in c,
static global variable in c++,
static variable in c,
static variable in c++,
difference between static and global variable in c++
scope of static variable in c,
static function in c,
extern variable in c,
SUBSCRIBE our channel at :
**************************************************
Follow Tech Talk Trick on Facebook
**************************************************
Follow tech talk trick on Twitter
**************************************************
Follow Tech Talk Tricks on Instagram
**************************************************
Subscribe tech talk tricks on YouTube
***************************************************
My Gadgets :
#RanaSingh #TechTalkTricks #static #clanguage #cprogramming #clanguage
In the C programming language, static is used with global variables and functions to set their scope to the containing file. In local variables, static is used to store the variable in the statically allocated memory instead of the automatically allocated memory.
Static Variables in C
Static variables have a property of preserving their value even after they are out of their scope!Hence, static variables preserve their previous value in their previous scope and are not initialized again in the new scope.
Syntax:
static data_type var_name = var_value;
Following are some interesting facts about static variables in C.
1) A static int variable remains in memory while the program is running. A normal or auto variable is destroyed when a function call where the variable was declared is over.
For example, we can use static int to count number of times a function is called, but an auto variable can’t be sued for this purpose.
For example below program prints “1 2”
int fun()
{
static int count = 0;
count++;
return count;
}
int main()
{
printf("%d ", fun());
printf("%d ", fun());
return 0;
}
At Tech Talk Tricks you will learn HTML, CSS, SQL, PL/SQL, JAVA and many more computer as well as mobile tips and tricks.
So please SUBSCRIBE to getting updated with the latest technology.
static variable in c++,
static global variable in c,
static function in c,
static variable vs global variable,
register variable in c,
static variable,
difference between static local and static global variable in c,
static global variable in c++,
static variable in c,
static variable in c++,
difference between static and global variable in c++
scope of static variable in c,
static function in c,
extern variable in c,
SUBSCRIBE our channel at :
**************************************************
Follow Tech Talk Trick on Facebook
**************************************************
Follow tech talk trick on Twitter
**************************************************
Follow Tech Talk Tricks on Instagram
**************************************************
Subscribe tech talk tricks on YouTube
***************************************************