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

Java''s layout managers give over traditional windowing syste, Java uses la...

Java uses layout managers to lay out components in a consistent manner across all windowing platforms. As Java's layout managers aren't tied to absolute sizing and positioning, the

Describe the features of electronic banking, Question 1: The Banking Ac...

Question 1: The Banking Act provides for banking services through interactive electronic systems. (a) Describe the features of electronic banking. (b) Show the responsibi

Microprocessor, how to stud for subject microprocessor

how to stud for subject microprocessor

Explain the concept of overriding, What is overriding? Overriding is an...

What is overriding? Overriding is an inherent part of association. It can show an ordered set of objects by writing {ordered} next to the appropriate association end. In 200

Principles for developing successful system, Q. Principles for developing s...

Q. Principles for developing successful system? (1)  Both developers and customers must be involved for accuracy in the information. (2)  A problem solving approach must be

What is a spool request, What is a Spool request? Spool requests are f...

What is a Spool request? Spool requests are formed during dialog or background processing and placed in the spool database with information about the printer and print format.

Basic definition of program, Q. Basic defination of program? A program ...

Q. Basic defination of program? A program generally consists of a set of instructions and data specifying the solution of a particular problem. Programs (and data) expressed in

Explain implementation techniques, Explain Implementation techniques Im...

Explain Implementation techniques Implementation techniques(e.g. remote invocation, HTTP). An event-based cooperation can be executed using message passing or it can  be based

Show how pages will be allocated using first-in-first-out, Consider the fol...

Consider the following page reference and reference time strings for a program: Page reference string: 5,4,3,2,1,4,3,5,4,3,2,1,5,..... Show how pages will be allocated using t

Decode the code, how to write mobile keypad program in c++

how to write mobile keypad program in c++

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