C语言学习 - 0003 static验证

 1 #include<stdio.h>
 2 void main()
 3 {
 4     int testofstatic();
 5     int a=0;
 6     a=testofstatic();
 7     printf("%d\n",a);
 8     a=testofstatic();
 9     printf("%d",a);
10     getchar();
11 }
12 
13 int testofstatic()
14 {
15     static int a=20;
16     a++;
17     return(a);
18 }

 

posted @ 2015-11-17 17:09  Yx37412  阅读(119)  评论(0编辑  收藏  举报