Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.PCS 1/10/84; site mtuxo.UUCP Path: utzoo!linus!decvax!bellcore!ulysses!mhuxr!mhuxt!houxm!mtuxo!hfavr From: hfavr@mtuxo.UUCP (a.reed) Newsgroups: net.lang.c Subject: Re: Arcane C hacks? Message-ID: <1318@mtuxo.UUCP> Date: Tue, 18-Feb-86 20:33:21 EST Article-I.D.: mtuxo.1318 Posted: Tue Feb 18 20:33:21 1986 Date-Received: Thu, 20-Feb-86 00:13:44 EST References: <1700003@umn-cs.UUCP> Organization: AT&T Information Systems Labs, Holmdel NJ Lines: 14 Robert Herndon writes: > I wrote a mild flame in another newsgroup about this, but > somebody out there might know another way. > The problem is this: I'd like to construct a jump table by > putting lots of labels into an array, and then issuing a > statement like > goto jumptab[i]; Such a table is automatically built by the compiler when you do switch (i) { case 1: goto label_a; case 2: goto label_b; } /* etc. */ This can do everything you need, and gives you the benefit of readable labels. Adam Reed (ihnp4!npois!adam)