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
How can I read and write comma-delimited text?
What are the benefits of c language?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Why is extern used in c?
What is a example of a variable?
what is the format specifier for printing a pointer value?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
What is void main () in c?
What is ambagious result in C? explain with an example.
Explain what is wrong with this program statement?
What is || operator and how does it function in a program?
How can you allocate arrays or structures bigger than 64K?
What are the types of pointers?
all c language question