The Scope of a Name
main(){
int a = 0;
int b = 0;
{
int b = 1;
{
int a = 2;
printf("%d %d\n",a,b);
}
{
int b = 3;
printf("%d %d\n",a,b);
}
printf("%d %d\n",a,b);
}
printf("%d %d\n",a,b);
}
most closely nested rule
Previous slide
Next slide
Back to first slide
View graphic version