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:
Can you show me the commands in each tab in the main interface?What is view (database)?
What is field?
How to compare and synchronize the partition functions?
What is trigger?
Related Questions:
What is data storage?What is extern function?
What is full text search?
Technical Support
Latest News
- How to connect to SQ...
- How to install Datab...
- How to remove SQL Se...
- How to compare and s...
- How many database ob...
- How to compare and s...
Awards
Customer Service |
| If you have any question or suggestion,please contact us. |
| Get Help>> |
:
: 

