- 论坛徽章:
- 0
|
回复 89# ypyf3000
tcpl
4.6 Static Variables
The variables sp and val in stack.c, and buf and bufp in getch.c, are for the private use of
the functions in their respective source files, and are not meant to be accessed by anything else.
The static declaration, applied to an external variable or function, limits the scope of that
object to the rest of the source file being compiled. External static thus provides a way to
hide names like buf and bufp in the getch-ungetch combination, which must be external so
they can be shared, yet which should not be visible to users of getch and ungetch.
看明白没,,the rest of,,,,,,何来全局, |
|