Storage class in C decides the part of storage to allocate memory for a variable, it also determines the scope of a variable.
All variables defined in a C program get some physical location in memory where variable's value is stored.
The storage class of a variable in C determines the life time of the variable if this is 'global' or 'local'.
The extern specifier gives the declared variable external storage class. The principal use of extern is to specify that a variable is declared with external linkage elsewhere in the program.
The variables declared as extern are not allocated any memory. It is only declaration and intended to specify that the variable is declared elsewhere in the program.
If a variable is declared as external then the compiler searches for that variable to be initialized somewhere in the program which may be extern or static. If it is not, then the compiler will show an error.
x: 10
compile time error main.c: In function ?main?: main.c:5:16: error: ?a? has both ?extern? and initializer extern int a = 0;