Explain advantage of static storage class, Computer Engineering

Assignment Help:

Explain advantage of static storage class

The second and more subtle use of 'static' is in connection with external declarations. With external constructs it provides a privacy mechanism that is very important for program modularity. By privacy, we mean visiblilty or scope restrictions on otherwise accessible variables or functions. The difference between 'extern' and 'static extern' is that static external variables are scope-restricted external variables. The scope is the remainder of the source file in which they are declared. Thus, they are unavailable to functions defined earlier in the file or to functions defined in other files, even if these functions attempt use the 'extern' storage class keyword.

Example:

void f()

{

}

Statements;      /* count is not available here */

static int count;         /* Static External Variable*/

void s()

{

 Statemetns;      /* count can be used here */

 }

 


Related Discussions:- Explain advantage of static storage class

Reading decision trees - artificial intelligence, Reading Decision Trees ...

Reading Decision Trees There is a link between decision tree representation and logical representations, which may be exploited to form it more easy  to understand and learned

How different are interface and abstract class in .net, How different are i...

How different are interface and abstract class in .Net? Abstract classes cannot be instantiated it can have or can't have abstract method basically known as must inherit as th

Data structure, what are the fundamental data structures

what are the fundamental data structures

Define the aims of program generation activity, Program generation activity...

Program generation activity aims at? Ans. At automatic generation of program the program generation activity aims.

Example of blocking probability for the three stage network, A three stage ...

A three stage network is realized by using switching matrices of size p x s in stage 1, r x r matrices in stage 2 and s x p matrices in stage 3. Using the Lee's probability graph s

What is the vertical organizational structure, What is the Vertical Organiz...

What is the Vertical Organizational Structure? This is a traditional approach that is typified by a functional approach to work in that departments work onto tasks relevant to

Hybrid model, The hybrid models are mostly tailormade models suiting to exa...

The hybrid models are mostly tailormade models suiting to exact applications. Actually these fall in the category of mixed models. Such type of application-oriented models keep cro

Shared memory model, In the shared-memory programming model, tasks share a ...

In the shared-memory programming model, tasks share a common address space, which they read and write asynchronously. Several mechanisms such as locks / semaphores may be used to c

Excess 3 codes, Explain Excess 3 Codes Ans. Excess 3 Codes 1....

Explain Excess 3 Codes Ans. Excess 3 Codes 1. This is the other form of BCD code. All decimal digits are coded in 4 bit binary code. 2. The code for all decimal di

What is capacitor-based keyboards, Q. What is Capacitor-Based Keyboards? ...

Q. What is Capacitor-Based Keyboards? These keyboards are based on the idea of Capacitance. A simple capacitor comprises a pair of conductive plates having opposite charges and

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd