what is the diff b/w static and non static variables in C.
Give some examples plz.
Answer Posted / anil kumar
Static variables are used for internal contextual
communication purpose.
non static variables are not used for contextual
communication
for that please go through the below code:
static int i=10;
int main()
{
int x=20;
Printf(“%d %d”,x, i);
Fun();
return 0;
}
Void Fun()
{
Printf(“%d”, i);
}
In the above code “i” is the static variable and “x “is the
local variable
Is This Answer Correct ? | 22 Yes | 7 No |
Post New Answer View All Answers
Can static variables be declared in a header file?
Is c easy to learn?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the c value paradox and how is it explained?
Why do we use return in c?
Explain the use of 'auto' keyword
What are the types of data files?
What does typeof return in c?
how do you programme Carrier Sense Multiple Access
How can I find the modification date and time of a file?
What is the use of getch ()?
why return type of main is not necessary in linux
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What are types of structure?
Why is #define used?