C语言学习(17)
1 //static的用法 2 #include<stdio.h> 3 void f(int a){ 4 static int b=2; 5 b=a+b; 6 printf("a=%d,b=%d\n",a,b); 7 } 8 9 int main(){ 10 int a=1,i; 11 for(i=1;i<=3;i++){ 12 f(a); 13 } 14 return 0; 15 }

posted on 2018-06-28 10:50 孙悟空son_ku_kong 阅读(93) 评论(0) 收藏 举报
浙公网安备 33010602011771号