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

C, write a code to decode the string"i need 1000 bucks"

write a code to decode the string"i need 1000 bucks"

Categorize the cpu scheduling algorithms, Categorize the CPU scheduling alg...

Categorize the CPU scheduling algorithms? The various CPU scheduling algorithms are categorized as given below:

Flowchart, how can we find compound interest through flowchart

how can we find compound interest through flowchart

Total number of registers in a cpu, Q. Total number of registers in a CPU? ...

Q. Total number of registers in a CPU? Factors to consider when choosing total number of registers in a CPU are:  CPU can access registers faster than it can access m

Program, Write a program to find the area under the curve y = f(x) between ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Factor causing parallel overheads, Performance metrics aren't able to attai...

Performance metrics aren't able to attain a linear curve in comparison to increase in number of processors in parallel computer. The main reason for above situation is presence of

Show the mips addressing modes, Q. Show the MIPS Addressing Modes? MIP...

Q. Show the MIPS Addressing Modes? MIPS Addressing Modes MIPS employs various addressing modes: 1. Uses Register as well asimmediate addressing modes for operations.

What is interactive reporting, What is interactive reporting? It helps ...

What is interactive reporting? It helps you to make easy-to-read lists.  You can view an overview list first that having general information and give the user with the possibil

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