void foobar(){
int local;
static int value;
class access{
void foo(){
local = 5; /* <-- Error here */
value = 10;
}
}bar;
}
void main(){
foobar();
}
Run Code Online (Sandbox Code Playgroud)
为什么不进入local内部foo()编译?OTOH我可以轻松访问和修改静态变量value.