Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!hao!nbires!isis!jay From: jay@isis.UUCP (Jay Batson) Newsgroups: net.lang.c Subject: Re: Switch case common code Message-ID: <799@isis.UUCP> Date: Wed, 11-Jun-86 11:45:22 EDT Article-I.D.: isis.799 Posted: Wed Jun 11 11:45:22 1986 Date-Received: Sun, 15-Jun-86 02:45:06 EDT References: <605@cisden.UUCP> <134@danews.UUCP> Reply-To: jay@isis.UUCP (Jay Batson) Organization: University of Denver Math and Computer Science Lines: 26 In article <134@danews.UUCP> lvc@danews.UUCP (Larry Cipriani) writes: >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 ? Yes. Craig, you're bright, and you've helped me lots before. But I agree with Larry for _this_ question. But, Craig's article _was_ an interesting posting, I'm sure all will agree. -------- "OK, so now, after it gets dark Lancelot and I will jump out of the rabbit, and take the castle by supr........ oh." Jay Batson {seismo,hplabs}!hao!isis!jay