What is a “static” function in C?

前端 未结 12 1197
野的像风
野的像风 2020-11-22 16:03

The question was about plain c functions, not c++ static methods, as clarified in comments.

I understand what a static variable is, but wha

12条回答
  •  被撕碎了的回忆
    2020-11-22 16:18

    The answer to static function depends on the language:

    1) In languages without OOPS like C, it means that the function is accessible only within the file where its defined.

    2)In languages with OOPS like C++ , it means that the function can be called directly on the class without creating an instance of it.

提交回复
热议问题