The declaration below:
static int *foo();
declares foo
as a static function returning a pointer to an int
.
What's the purpose of declaring a function as static ?
The function's name isn't visible outside the translation unit (source file) in which it's declared, and won't conflict with another function foo
in another source file.
In general, functions should probably be declared static
unless you have a specific need to call it from another source file.
(Note that it's only the name that's not visible. It can still be called from anywhere in the program via a pointer.)