Chinaunix首页 | 论坛 | 博客
  • 博客访问: 34761
  • 博文数量: 23
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 235
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-20 09:41
文章分类
文章存档

2011年(1)

2010年(2)

2009年(20)

我的朋友

分类: C/C++

2009-02-20 10:31:04

the static identifier:

In C, if a local variable is declared static, a separate memory location is allocated for that variable. This variable retains the value between function calls, like a global variable. So next time when a function is called again it finds the old value. Also a local static variable is initialized only once.

但是static的变量值是可以改变的。 只是赋值只语句只执行一次。

例子:
阅读(316) | 评论(0) | 转发(0) |
0

上一篇:开博

下一篇:const in c

给主人留下些什么吧!~~