Malcolm McLean said:
The function declared static can only be called from another function
within the same file. This is very useful in complex projects, because it
simplifies the connections between modules.
yes, as others have noted, the name is hidden from other source files.
however:
int fl()
{
static int init=0;
...
}
is a little different, be careful not to confuse them...
in many tools, static toplevel declarations are handled at the assembler
level (non-exported symbols are not externally visible, or similar), wheras
in my comipler, this kind of thing is usually done by giving the values a
cryptic autogenerated name (my case, a 96-bit psuedorandom value encoded in
a base-48 scheme, partly because my assembler/linker internally assumes all
symbols are global).
as for the next point:
personally I dislike the use of using static declarations to hide functions
or variables in this way (primarily because the area in which I may need the
variable may infact be somewhat larger than a single source file, but not to
the level of whole-project, ...).
as a result, I tend to instead use special naming conventions.
as elsewhere:
<lib>_<part>_<name>
where for variables, it is usually an all lowercase scheme (as a result, for
global variables I may split name words with underscores as well).
for functions I typically use the FirstLettersAreCaps convention.
I rarely use camelCase, except sometimes in shared APIs (this is usually for
code where I separate the front-end api from the rest of the code in a
particular lib).
as an example (a part of my 3D-engine's entity system):
void LBXGL_Entity_GetPropertyFVector(LBXGL_Entity *ent, char *name, float
*fv, int n);
vs (an external API function for my physics lib):
void bsdeSet3FV(int obj, int val, float *fv);
where internally the lib uses a convention more like the above...