PDA

View Full Version : static functions


usha
01-20-2006, 09:18 AM
[urgent]hi
i want to know about static functions, its uses and its examples.
thanking u
bye

i3839
01-20-2006, 01:06 PM
A static function is only accessible in the C-file it is defined. The function will not have a symbol and won't be accessible from other (binary) files. Because of this the compiler can optimize the code more, as it can know about all usages of the function. If it's a static function called only in one place it may be inlined for instance, as that saves instructions. So in general it's best to make a function static whenever possible. Other than the visibility, a static function is the same as normal functions.