"asit" <li*****@gmail. comwrote in message
news:fd******** *************** ***********@n20 g2000hsh.google groups.com...
Can functions have static storage clas ??
yes , they can.
If yes, what is it's advantage ??
the "advantages " , if one can call that , are:
the static keyword makes the functions local to the file (more accurately
"translatio n unit") in which it is defined. This means the function can be
called only within that fileTherefore it
1) Provides modularity by data hiding and
2) Gives an opportunity to the compiler to optimize better (by say inlining)
In certain cases a "static" "inline" function is a type-safe replacement for
a preprocessor macro.