Path: utzoo!attcan!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.std.c Subject: Re: Declarations in switches, errors Message-ID: <1202@virtech.UUCP> Date: 28 Sep 89 00:43:19 GMT References: <561@crdos1.crd.ge.COM> <10041@xanth.cs.odu.edu> Organization: Virtual Technologies Inc Lines: 22 In article <10041@xanth.cs.odu.edu>, kremer@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 | +-----------------------------------------------------------------------+