C 静态函数

1、Java的静态方法,主要是为了供用户方便的调用。采用“类名.方法名”的方式访问。

比如Math类中的大多数方法是静态的。

2、C中函数前加 static主要是对作用域进行限制。如下:

A "static" function tells the compiler that other program files cannot see or access the function. Only other functions from the same file can see a static function. Therefore, to declare a function local only to the file the programmer defines it in.

原文地址:https://www.cnblogs.com/aqing1987/p/4203229.html