Write examples of declarations of external variables, Computer Engineering

Examples of declarations of external variables  that  are  not definitions:

extern char stack[10];

extern int stkptr;

These declarations tell the compiler that the variables stack[] and stkptr are defined elsewhere, usually in some other file. If the keyword extern were omitted, the variables would be considered to be new ones and memory would be allocated for them. Remember, access to the same external variable defined in another file is possible only if the keyword extern is used in the declaration.

/* File : ext.c

This example shows reference to an external variable in more than one file. The program is organized in three files. The external variable 'a1' is defined in 'ext.c', and it is declared as extern in 'FILE3.c' */

 

 

Posted Date: 6/14/2013 6:55:46 AM | Location : United States







Related Discussions:- Write examples of declarations of external variables, Assignment Help, Ask Question on Write examples of declarations of external variables, Get Answer, Expert's Help, Write examples of declarations of external variables Discussions

Write discussion on Write examples of declarations of external variables
Your posts are moderated
Related Questions


Discuss its advantages over the other evaluation techniques. The expression tree is determined by using a post-order traversal of the expression tree as given here: 1. If such

what is system programming? System programming is the activity of implementing and designing SPs. System programs that are the standard component of the s/w of most computer

What is macro call? Explain. Macro call: While a macro name is used along with a set of actual parameters this is replaced through a code generated from its body. Such code

Q. What is Single Program Multiple Data (SPMD) SPMD is in fact a "high level" programming model which can be built on any arrangement of previously described parallel programmi

The following switching functions are to be implemented using a Decoder f 1   = ∑ m(1, 2, 4, 8, 10, 14)   f 2   = ∑ m(2, 5, 9, 11)   f 3   = ∑ m(2, 4, 5, 6, 7) The minimum configur

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Design a game application that plays the children's game of rock, paper, scissors. The user enters a letter indicating a choice. The Math.random method is then used to pick a value

Design a 32:1 multiplexer using two 16:1 multiplexers and a 2:1 multiplexer Ans. Design a 32 X 1 MUX by using two 16 X 1 MUX and one 2 X 1. Now here total 32 input lines