Answer Posted / sasi
Whenever Static is used with a Variable declaration .. it defines that the last updated value of the Variable will not be deleted after the process of a program .
Eg : #include <stdio.h>
int main() {
func();
func();
func();
}
void func() {
static int i=2;
i=i+1;
printf("%d
",i);
return 0;
}
Output :
3
4
5
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to declare a variable?
Describe newline escape sequence with a sample program?
What is a good data structure to use for storing lines of text?
How can I read a binary data file properly?
When the macros gets expanded?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What is stack in c?
Explain what is operator promotion?
formula to convert 2500mmh2o into m3/hr
What is the benefit of using const for declaring constants?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
How many bytes are occupied by near, far and huge pointers (dos)?
What is an auto keyword in c?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What is memcpy() function?