Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site danews.UUCP Path: utzoo!watmath!clyde!cbosgd!danews!lvc From: lvc@danews.UUCP (Larry Cipriani) Newsgroups: net.lang.c Subject: Re: Switch case common code Message-ID: <134@danews.UUCP> Date: Mon, 9-Jun-86 23:01:00 EDT Article-I.D.: danews.134 Posted: Mon Jun 9 23:01:00 1986 Date-Received: Thu, 12-Jun-86 22:10:23 EDT References: <605@cisden.UUCP> Organization: AT&T Bell Labs, Columbus OH Lines: 25 The 'best' I think that can be done is to do something like: switch (switch_variable) { case a: ... ... goto common; break; case b: ... ... common: common_code_for_a_and_b break; case c: ... ... break; } Gotos are usually abused, but I think the for/while stuff shown is just awful. I think this is a lot easier to understand. No ? -- Larry Cipriani AT&T Network Systems danews!lvc "Nothing is worse than an itch you can never scratch."