原文:http://bytes.com/topic/c/answers/925791-scope-global-static-variable
重点部分:
Duration (more formally called storage class)
Duration refers to the interval during which the memory associated with a variable is used for that variable. Storage duration can be static, automatic, or allocated. Variables defined outside of block scope or with the static keyword have static duration and are guaranteed to exist until the program ends. Variables defined inside of block scope, but without the static keyword, have automatic duration and are only guaranteed to exist until the flow of control leaves that block. Variables created by malloc, calloc, or realloc have allocated duration and exist until explicitly destroyed by free or realloc or the program ends, whichever comes first.
Linkage
Linkage refers to the scope within which a variable name is recognized. Linkage can be none, internal, or external. Variables defined within a block have no linkage -- they cannot be accessed outside of that block. Variables defined outside of block scope and with the static keyword have internal linkage -- they can only be accessed locally within the compilation unit (source file) in which they appear. Variables defined outside of block scope without the static keyword have external linkage -- they can be accessed from any compilation unit that has a matching declaration.