Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!genrad!panda!talcott!harvard!seismo!brl-adm!brl-smoke!smoke!gwyn@BRL.ARPA From: gwyn@BRL.ARPA (VLD/VMB) Newsgroups: net.lang.c Subject: Re: Arcane C hacks? Message-ID: <1435@brl-smoke.ARPA> Date: Sun, 2-Mar-86 22:05:03 EST Article-I.D.: brl-smok.1435 Posted: Sun Mar 2 22:05:03 1986 Date-Received: Tue, 4-Mar-86 03:59:16 EST Sender: news@brl-smoke.ARPA Lines: 17 I can think of two legal ways to implement the goto jumptab[i]; idea in C, assuming you need the flexibility of reassigning the destinations for each i: (1) Use an array of jmpbufs, do something to get them initialized using setjmp (that's the hard part), and longjmp to the correct jmpbuf array member. (2) Use an array of function pointers, initialize them as desired, and call via the appropriate function array member (watch out that you don't keep recursing deeper and deeper; it's probably best to have a common return from the functions). I suspect that if we knew your intended application, better solutions would be possible. Just what do you think you need a jump table for?