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 many keywords (reserve words) are in c?
What is a c token and types of c tokens?
Explain how can a program be made to print the name of a source file where an error occurs?
What's a good way to check for "close enough" floating-point equality?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
Can true be a variable name in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
Is it better to use malloc() or calloc()?
Is c procedural or object oriented?
How can I do peek and poke in c?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
Explain what is the benefit of using an enum rather than a #define constant?
Explain why c is faster than c++?
What is the best way to comment out a section of code that contains comments?
Explain the properties of union. What is the size of a union variable