33,311
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
static int i = 0;
int fun()
{
static int i = 5;
return ++i;
}
int main()
{
int test;
test = fun();
test = fun();
test = fun();
printf("%d\n",test);
return 0;
}
1、最后test值是多少
2、在函数fun中 i是定义还是声明
3、静态变量的生命周期