|
-
September 18th, 2002, 11:13 AM
#1
label declaration space block
As per specs, chapter 3, basic concepts...
"Each block or switch-block creates a separate declaration space for labels. Names are intorduced into this declaration space through labeled statements, and the names are referenced through goto-statements. The label declaration space of a block icludes any nested blocks, Thus, within a nested blocks it is not possible to declare a label wiht the same names as a label in a n enclosing block."
why the following code is perfectly compiled?
class A
{
void foo()
{
for( int i = 0 ; ; i++ )
if( i == 1 ) goto yourend;
yourend:
{
int k = 0;
yourend:
{
int l = 0;
}
}
}
}
-
September 18th, 2002, 01:30 PM
#2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|