Declarations in switches, errors
Conor P. Cahill
cpcahil at virtech.UUCP
Thu Sep 28 10:43:19 AEST 1989
In article <10041 at xanth.cs.odu.edu>, kremer at cs.odu.edu (Lloyd Kremer) writes:
> No, a switch statement is entered by a jump to a label. The jump is to
> any one of several places depending on which "case" is true, but an automatic
> initialization at the start of a switch statement is never performed. The
> variable is brought into scope within the switch block, but the initial
> contents of the variable are garbage.
If this is the standard, I think it is broken. If the compiler allows
a variable declaration, it should allow an initialization.
--
+-----------------------------------------------------------------------+
| Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 !
| Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 |
+-----------------------------------------------------------------------+
More information about the Comp.std.c
mailing list