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

What is cable modem, Q What is Cable Modem? One more way of accessing I...

Q What is Cable Modem? One more way of accessing Internet currently being developed is use of cable modems. These require that you subscribe to a cable service as well as allow

Computer networks, distributed & centralized system in computer network

distributed & centralized system in computer network

What is an imperative statement, What is an imperative statement? Ans. ...

What is an imperative statement? Ans. Shows an action to be performed throughout execution of assembled program is an imperative statement.

Smart card & e-cash, Smart Card & E-Cash E-cash storable smart cards ca...

Smart Card & E-Cash E-cash storable smart cards can kept and dispense cash electronically, making bills and coins lesser essential. It transfers funds over phone lines, making

In which network configuration all data/information pass, A distributed net...

A distributed network configuration in which all data/information pass through a central computer is (A)  Bus network                            (B) Star network (C)  Rin

Interaction design and human–computer interaction, You should now have a re...

You should now have a reasonably clear understanding of what is meant by interaction design. However, there are several other terms which are often used to refer to particular aspe

Explain real time operating system, Explain Real Time Operating System? ...

Explain Real Time Operating System? Real time operating System: A real-time operating system has suitably-defined, fixed time constraints. Processing should be done in the d

Determine frame time and propagation time in a lan, Maximum channel utiliza...

Maximum channel utilization in a LAN is defined by frame time (t f ) and propagation time (t p ). It is defined by (A) t p /t f (B) t f /t p  (C) 1 + (t f /t p )

What is domain analysis, What is domain analysis? Domain analysis is c...

What is domain analysis? Domain analysis is concerned with devising a precise, concise, understandable and correct model of the real world. Analysis starts with problem statem

What are different ways synchronize between two clock domain, What are the ...

What are the different ways synchronize between two clock domains? The following section describes clock domain interfacing one of the biggest challenges of system-on-chip (SOC

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