学习 static 定义静态变量的用法
学习 static 定义静态变量的用法
#include <stdio.h>
void foo()
{
static int x=0;
x++;
printf("%d\n",x);
}
int main()
{
foo();
foo();
foo();
return 0;
}
学习 static 定义静态变量的用法
#include <stdio.h>
void foo()
{
static int x=0;
x++;
printf("%d\n",x);
}
int main()
{
foo();
foo();
foo();
return 0;
}