#include<stdio.h>
void func1(void); //函数声明
int count = 3;
int main()
{
while (count--) {
func1();
}
return 0;
}
void func1(void)
{
static int t = 5; // t使用 static 修饰后,不会在每次调用时重置。
//int t = 5;
t++;
printf("t为 %d\n count 为 %d\n", t, count);
}
c static
最新推荐文章于 2024-06-19 15:39:10 发布