Answered Questions

  • What is a 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.

    i_spy

    • Dec 25th, 2007

    Suppose void a(){} is defined in file1.c. If you declare it extern in file2.c then you can use it in file2.c. So its scope in not within file1.c. But if you declare it as static in file1.c then it can not be used in any other file.