Published on: 12th Nov 2010    |   Last Updated on: 24th Nov 2011

External Storage Class :

Syntax :

	extern [data_type] [variable_name];
	
Example :

	extern int a;
	

The variable access time is very fast as compared to other storage classes. But few registers are available for user programs.

The variables of this class can be referred to as 'global or external variables.' They are declared outside the functions and can be invoked at anywhere in a program.


Program :

/*  Program to demonstrate external storage class.
Creation Date : 06 Nov 2010 11:15:04 PM
Author : www.technoexam.com [Technowell, Sangli] */

#include <stdio.h> #include <conio.h> extern int i=10; void main() { int i=20; void show(void); clrscr(); printf("\n\t %d",i); show(); getch(); } void show(void) { printf("\n\n\t %d",i); }

Output :



	20

	10_

Link this post on your Blog/Website :

Follow us on :   Technoexam on facebook Technoexam on twitter Technoexam on linkedin Technoexam on youtube