Date: Thu, 5 Aug 1999 20:08:21 -0400 Message-Id: <199908060008.UAA10923@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (rithe@mailcity.com) Subject: Re: interesting error References: Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > I got an error in a switch statement: case bypasses local variable > initialization. any ideas what it is and how to fix? Instead of this: switch (x) { case 3: int x = 0; } do this: int x; switch (x) { case 3: x = 0; } or sometimes this: switch (x) { case 3: int x; x = 0; } or even this: switch (x) { case 3: { int x = 0; } }