'static' function?

lvs at ndm20 lvs at ndm20
Tue Jul 8 02:49:00 AEST 1986


> jhhur at kaist.UUCP writes:

>What is the meaning of 'static' function?  Does it mean that the return value
>is allocated a memory location rather than the top of C stack?  If so,
>what is the relevance of a memory location for a return value?

The act of declaring a function static in no way affects the return value of
the function.  It merely restricts the scope of the function name to the
file in which it lives.  That is, the name of the function is NOT an external
symbol and may not be referenced by functions in a seperately compiled unit.

Note that this is the only way to restrict the scope of a function name.
Without being defined 'static' all function names are external symbols.


Hope this helps,
Larry V. Streepy Jr.                        "Waiting is"
Nathan D. Maier Consulting Engineers

VOICE:  (214)739-4741
Usenet: {seismo!c1east | cbosgd!sun | ihnp4}!convex!infoswx!ndm20!lvs
CSNET:  ndm20!lvs at smu
ARPA:   ndm20!lvs%smu at csnet-relay.ARPA



More information about the Comp.unix.wizards mailing list