What does static mean in c?



What does static mean in c?..

Answer / 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

More C Interview Questions

What is type qualifiers?

1 Answers  


what is the difference between postfix and prefix unary increment operators?

3 Answers  


How can draw a box in cprogram without using graphics.h header file & using only one printf(); ?

4 Answers   NIIT,


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1 Answers   CLG,


What is modeling?

1 Answers  


How can I read a directory in a c program?

1 Answers   CSC,


write a programme that inputs a number by user and gives its multiplication table.

2 Answers  


How to write c functions that modify head pointer of a linked list?

1 Answers  


what is the c source code for the below output? 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1

0 Answers  


logic for generating all the combinations of the any number of given letters. ex::::::::: if a,b,c,d are given the o/p should be abcd,dcba,dbac,bcad,................ 4*3*2*1 combinations............

2 Answers   Infosys,


Where are the auto variables stored?

1 Answers   TISL,


what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string

3 Answers  


Categories