www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Labels at end of code blocks

reply Joey Peters <Joey_member pathlink.com> writes:
Probably people already found out about this, but you can't put labels at the
end of codeblocks.

void main() {
goto x;
x: // error
}

void main() {
goto x;
x:
int nothing;
}
Sep 14 2004
parent J C Calvarese <jcc7 cox.net> writes:
Joey Peters wrote:
 Probably people already found out about this, but you can't put labels at the
 end of codeblocks.
 
 void main() {
 goto x;
 x: // error
 }
These seem to work, though: void main() { goto x; x: return; } void main() { goto x; x: ; }
 
 void main() {
 goto x;
 x:
 int nothing;
 }
-- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Sep 14 2004