[問題] uses of the keyword static

作者: bjk (Up2u)   2016-05-08 14:37:35
想請問BC是甚麼意思
感恩~~
http://goo.gl/6tgJR
Static
6. What are the uses of the keyword static?
This simple question is rarely answered completely. Static has three
distinct uses in C:
(a) A variable declared static within the body of a function maintains its
value between function invocations.
(b) A variable declared static within a module[1], (but outside the body
of a function) is accessible by all functions within that module. It is not
accessible by functions within any other module. That is, it is a localized
global.
(c) Functions declared static within a module may only be called by other
functions within that module. That is, the scope of the function is localized
to the module within which it is declared.
Most candidates get the first part correct. A reasonable number get the
second part correct, while a pitiful number understand answer (c). This is a
serious weakness in a candidate, since they obviously do not understand the
importance and benefits of localizing the scope of both data and code.
作者: CoNsTaR ((const *))   2016-05-08 14:49:00
作者: bjk (Up2u)   2016-05-08 15:20:00
其實這個我看了中文還是不太懂QQ

Links booklink

Contact Us: admin [ a t ] ucptt.com