在块内声明静态变量和在文件中的块外部之间有什么区别?例如,这里,静态变量a,b,c,d之间有什么区别?我们可以声明一个可以从程序的所有文件访问的静态变量吗?
static int a;
void getVol(..)
{
static int b;
}
int main()
{
static int c;
while(condition)
{
static int d;
....
}
some code here;
return 0;
}
Run Code Online (Sandbox Code Playgroud)