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
What are conversion routines? Non-standard conversions from present format to sap internal format and vice-versa are executed with so known as conversion routines.

What is a Size Category? The Size category verifies the probable space needs of the table in the database.

Futoshiki is a game played on an N by N (usually 5 by 5) grid and uses the symbols 1 .. N. The objective of the game is to place each symbol on the grid so that it only occurs once

Q. Explain about Multi tasking environment? Multi tasking uses parallelism by: 1) Pipelining functional units are pipe line mutually 2) Simultaneously employing multiple

Interfacing Subroutines with Parameter Passing Let's now write a C program which calls the assembly program for parameter passing. Let's extend the previous two programs such t

Telnet It is a terminal emulation program for TCP/IP networks like as the Internet. The Telnet program runs on your computer and attaches your PC to a server on the network. On

a)   Make a cell array variable that would kept for a student his or her name, university id number, and GPA.  Print this information. b) Make a structure variable that would kept

Define Mapping and List  mapping procedure? The transformation of data from main memory to cache memory is known as an Mapping. Associative mapping Direct mapping

Details about nanoprogram

What are qualified associations? A qualified association is an association in which an attribute known as the qualifier disambiguates the object many associated end.