Why does initializing an extern variable inside a function give an error?
The reason defining an external variable inside a function does not make sense is the following: When you declare a symbol extern, you are telling the compiler to link all such occurrences of this value into the same symbol. Any occurences of extern int i; in your program would link to the externally defined i. … Read more