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 is meant by global static? why we have to use static
variable instead of Global variable

Answer Posted / indira amit

Variables defined local to a function disappear at the end
of the function scope. So when we call the function again,
storage for variables is created and
values are reinitialized. So if we want the value to be
extent throughout the life of a program, we can define the
local variable as "static." Initialization is performed only
at the first call and data is retained between func calls.

Had it been gloal variable, it would have been available
outside the scope of the function, but static variable is
not available outside the scope of a function (helpful in
localizing errors - as it can't be changed outside the func
scope).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it cc or c in a letter?

960


When should the volatile modifier be used?

1107


What is the difference between fread and fwrite function?

1033


What is a MAC Address?

1004


What is data type long in c?

1025


I need previous papers of CSC.......plz help out by posting them.......

2247


a c code by using memory allocation for add ,multiply of sprase matrixes

2743


What is volatile variable in c with example?

996


Explain what is the benefit of using enum to declare a constant?

1019


What are the advantages of using new operator as compared to the function malloc ()?

1268


can any one provide me the notes of data structure for ignou cs-62 paper

2117


Describe how arrays can be passed to a user defined function

1223


Can you pass an entire structure to functions?

1078


What are the advantages of c preprocessor?

1209


What is a stream?

1078