首页 > 其他 > 详细

C 静态函数

时间:2015-01-05 12:50:43      阅读:371      评论:0      收藏:0      [点我收藏+]

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.

C 静态函数

原文:http://www.cnblogs.com/aqing1987/p/4203229.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!