Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What does static mean in c?

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


Please Help Members By Posting Answers For Below Questions

What is the advantage of c?

1105


What does printf does?

1222


Can we change the value of static variable in c?

1005


how to write a c program to print list of fruits in alpabetical order?

2282


write a c program in such a way that if we enter the today date the output should be next day's date.

2179


Can you define which header file to include at compile time?

1007


How many parameters should a function have?

1168


Explain what is a pragma?

1030


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

1342


Are pointers really faster than arrays?

1006


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1051


What are the types of bitwise operator?

1092


Explain about the functions strcat() and strcmp()?

1033


What is a volatile keyword in c?

1143


What are the salient features of c languages?

1084