Storage class specifiers in C: extern variable

A storage class specifier is used to inform compiler how a variable must be stored. There are four storage class specifiers in C: extern, static, register and auto. General form of storage class specifiers:

storage_specifier type variable_name;


extern is used to inform the compiler that the following variable types have been defined elsewhere in the program. General form for extern

extern variable_list;

extern is also used to declare a global variable inside a function:

int a, b;

void main ()


extern int a;




Leave a Reply