Why does extern int n not compile when n is declared (in a different file) static int n, but works when declared int n? (Both of thes
According to MSDN documentation:
When modifying a variable, the static keyword specifies that the variable has static duration (it is allocated when the program begins and deallocated when the program ends) and initializes it to 0 unless another value is specified. When modifying a variable or function at file scope, the static keyword specifies that the variable or function has internal linkage (its name is not visible from outside the file in which it is declared).
http://msdn.microsoft.com/en-us/library/s1sb61xd(v=vs.80).aspx: June 2013