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 many keywords (reserve words) are in c?

1184


What is a c token and types of c tokens?

1127


Explain how can a program be made to print the name of a source file where an error occurs?

1245


What's a good way to check for "close enough" floating-point equality?

1253


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1261


Can true be a variable name in c?

1088


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1321


Is it better to use malloc() or calloc()?

1173


Is c procedural or object oriented?

1085


How can I do peek and poke in c?

1135


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

1922


Explain what is the benefit of using an enum rather than a #define constant?

1274


Explain why c is faster than c++?

1124


What is the best way to comment out a section of code that contains comments?

1387


Explain the properties of union. What is the size of a union variable

1247