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
What is the maximum length of an identifier?
What are the benefits of organizational structure?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
What is d scanf?
How can you find the day of the week given the date?
What are static variables in c?
What does main () mean in c?
Explain how do you declare an array that will hold more than 64kb of data?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
What is local and global variable in c?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What is meant by initialization and how we initialize a variable?
program for reversing a selected line word by word when multiple lines are given without using strrev
What math functions are available for integers? For floating point?