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

Can you assign a different address to an array tag?

1163


What is the data segment that is followed by c?

1081


What are the benefits of organizational structure?

1020


Why do we use stdio h and conio h?

1081


What is the symbol indicated the c-preprocessor?

1240


Why do we write return 0 in c?

1049


What is the use of a ‘’ character?

1086


Is malloc memset faster than calloc?

1069


Can an array be an Ivalue?

1089


What is the purpose of scanf() and printf() functions?

1239


differentiate built-in functions and user – defined functions.

1084


write an algorithm to display a square matrix.

2702


What are compound statements?

1171


Where define directive used?

1087


In C, What is the #line used for?

2199