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

Probabilistic hough transformation, The probabilistic Hough transform uses ...

The probabilistic Hough transform uses random sampling instead of an accumulator array. In this approach the number of random samples r, is not specified in the OpenCV call, but

Which scheduling in cpu is allocate for least cpu-burst time, The schedulin...

The scheduling in which CPU is allocated to the process with least CPU-burst time is called? Ans. Shortest job first Scheduling wherein CPU is allocated to the process with lea

State the importance of CRT monitor, State the importance of CRT monitor ...

State the importance of CRT monitor CRT is considered to be one of the most important component because the quality of displayed image influences the perception of generated de

Introduction to parallel computing, Introduction  To Parallel Computing ...

Introduction  To Parallel Computing Parallel computing has been a subject of importance in the computing community over the last few years. Ever-growing volume of databases and

Explain the working of a 1-to-16 Demultiplexer, Using a suitable logic diag...

Using a suitable logic diagram explain the working of a 1-to-16 de multiplexer. Ans. 1-to-16 Demultiplexer Working: A demultiplexer obtains in data from one line and directs this

Explain telephone hand set and working, Explain Telephone hand set and it's...

Explain Telephone hand set and it's working. A standard telephone set is consisted of a transmitter, electrical network and a receiver for equalization, connected circuitry to

Explain moores law and amdahls law, Question (a) Imagine you need to mo...

Question (a) Imagine you need to move people through a distance of 10 miles, with the following specifications. • Car: capacity = 5, speed = 60 miles/hour • Bus: capacity

Where shared resources are accessed, A critical section is a program segmen...

A critical section is a program segment? Ans. A critical section is a program segment where shared resources are accessed.

What is index register, What is index register? In index mode the effec...

What is index register? In index mode the effective address of the operand is formed by adding a constant value to the contents of a register. The register used might be either

Aussie wine tours awt, Business Narrative Aussie Wine Tours (AWT) condu...

Business Narrative Aussie Wine Tours (AWT) conduct tours of the wineries of Victoria's Yarra Valley wine region. The tours take place on the last Sunday of each month. Currentl

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