internal & external static

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RS24
    New Member
    • Oct 2006
    • 9

    internal & external static

    Hi!
    What are internal & external staticvariables and functions? what's their scope and how do they differ?
  • tyreld
    New Member
    • Sep 2006
    • 144

    #2
    Declaring a function or global variable static restricts its scope to the file it is defined in. In other words a static function or global variable can only be referenced by functions in the same file.

    Declaring a variable within a function static causes the variable to be initialized at compilation time, and it will therefore retain its value between function calls.

    Declaring a function prototype or global variable extern introduces that function or variable into the local file when it is defined or declared in a seperate file.

    Comment

    Working...