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

How to declare a variable?

959


Describe newline escape sequence with a sample program?

1071


What is a good data structure to use for storing lines of text?

1033


How can I read a binary data file properly?

1076


When the macros gets expanded?

1339


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

1200


What is stack in c?

1028


Explain what is operator promotion?

1024


formula to convert 2500mmh2o into m3/hr

941


What is the benefit of using const for declaring constants?

990


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?

994


How many bytes are occupied by near, far and huge pointers (dos)?

1115


What is an auto keyword in c?

1045


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3285


What is memcpy() function?

1047