What is static function?
A static function is a function whose scope is limited to the current source file. Scope refers to the visibility of a function or variable. If the function or variable is visible outside of the current source file, it is said to have global, or external, scope. If the function or variable is not visible outside of the current source file, it is said to have local, or static, scope.
A static declaration within a function directs the compiler to place the variable in persistent (global) storage instead of placing it on the stack (automatic storage class). The value will be retained from call to call unlike an automatic variable and only initialized once. A static variable can also be defined/declared at file scope where its name will be visible only within that file and where it has persistent storage (but will not be linked with extern variables of the same name).
Defining:
static int f(int a,int b)
The meaning of static here is not a static storage, and the scope of the function is limited to the current file. Therefore, the advantages of static function is: same name of static function can be defined in different source files.
Tags: static function static storage scope
Readers also visit these:
What is field?What is view (database)?
What is trigger?
What is index (database) ?
What is rule (database)?
Related Questions:
What is data storage?What is extern function?
What is full text search?
Technical Support
Latest News
- Can you show me the ...
- How to compare and s...
- How to compare and s...
- How to compare and s...
- How to compare and s...
- Which license is bes...
Awards
Customer Service |
| If you have any question or suggestion,please contact us. |
| Get Help>> |
:
: 

