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

Radius of curvature in differential calculas, find the radius of curvature ...

find the radius of curvature at the point (3,3) at a point x3+xy2-6y2=0?

C Programming, Program about railway reservation system using structure . G...

Program about railway reservation system using structure . Get 10 names,their gender ,address , seats availability according to trains and some extra datas

Post interrupts - computer architecture, Post interrupts - computer archite...

Post interrupts - computer architecture: Post interrupts Exact interrupts examine interrupt bit on entering WB Longer latency Handle immediately

Layered architecture of electronic data interchange, Illustrated about the ...

Illustrated about the layered architecture of Electronic Data Interchange? Layered Architecture of EDI: Electronic Data Interchange is most commonly applied into th

What are the benefits of micro programmed control, a. What are the benefits...

a. What are the benefits of hardwired and micro programmed control? b. Sketch neat diagram of single bus organization of CPU showing ALU, all types of registers and the data pat

Mpi, write an8086 alp to exchange a block of N bytes of data between sourc...

write an8086 alp to exchange a block of N bytes of data between source and destination

Illustrate shift micro-operations, Q. Illustrate Shift Micro-operations? ...

Q. Illustrate Shift Micro-operations? Shift is a valuable operation that can be used for serial transfer of data. These operations can also be used along with other (arithmetic

Define speculative execution, Define speculative execution. Speculative...

Define speculative execution. Speculative execution means that instructions are implemented before the processor is particular that they are in the correct execution sequence.

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