This seems very trivial but a somewhat rigorous explanation for the following behavior will help my understanding of extern
a lot.So I\'ll appreciate your answe
extern
variable declaration is a promise to the compiler that there would be a definition of a global variable some place else. Local variables do not qualify as fulfillments of the promise to the compiler, because they are invisible to linkers. In a sense, extern
declarations are similar to forward declarations of functions: you say to the compiler "I know this function is there, so let me use it now, and let linker take care of locating the actual implementation".