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 |
if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?
is it possible to create your own header files?
What is the difference between #include <header file> and #include “header file”?
What is meaning of "Void main" in C Language.
24 Answers Ford, GU, HCL, IBIBS, JUW, TCS,
Why we use void main in c?
How does free() know explain how much memory to release?
In scanf h is used for
Apart from dennis ritchie who the other person who contributed in design of c language.
Why c is a procedural language?
What is a pointer?
What is the difference between ‘g’ and “g” in C?
What are the Advantages of using macro