explain the storage class extern the storage


Explain The Storage Class extern

The Storage Class extern : One method of transmitting information across blocks and functions is to use external variables. When a variable is declared outside the function, storage is permanently assigned to it, and its storage class is 'extern'. A declaration for an external variable can look just the same as declaration for a variable that occurs inside a function or block. Such a variable is considered to be global to all functions declared after it, and upon exit from the block or function, the external variable remains in existence.

An example is

int a,b,c; /* Global Variables*/

void main()

{

Statements;

}

We can also rewrite the above example starting with 'extern'

extern int a, b, c;

void main()

{

Statements;

}

This use of 'extern' will cause  runtime errors in traditional compilers.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: explain the storage class extern the storage
Reference No:- TGS0305415

Expected delivery within 24 Hours