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 are the different properties of variable number of arguments?
What are the string functions? List some string functions available in c.
How reliable are floating-point comparisons?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
How can I avoid the abort, retry, fail messages?
Explain how can type-insensitive macros be created?
What is main () in c?
What are identifiers and keywords in c?
What are c preprocessors?
find out largest elemant of diagonalmatrix
How to write c functions that modify head pointer of a linked list?
What is the use of c language in real life?
What is the use of function in c?
What is difference between structure and union?
Explain zero based addressing.