Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site hwcs.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!harpo!ulysses!mhuxl!houxm!hogpc!houti!ariel!vax135!ukc!edcaad!hwcs!chris From: chris@hwcs.UUCP Newsgroups: net.unix-wizards Subject: Re: Ctype.h (start arrays at 1 then add 1 before looking up) Message-ID: <62@hwcs.UUCP> Date: Thu, 5-Apr-84 04:39:36 EST Article-I.D.: hwcs.62 Posted: Thu Apr 5 04:39:36 1984 Date-Received: Wed, 4-Apr-84 03:26:37 EST References: <2189@ecsvax.UUCP> Organization: Computer Sci., Heriot-Watt U., Scotland Lines: 13 I prefer the following technique for -1 origin arrays (or indeed any other origin). I think it is easier to understand, because it makes no assumption that C will preserve the order of fields within a structure, and will insert no padding between them: ------------------------------------------------------ char tableinit[129] = { /* Initial values ... */ }; char *table = tableinit+1; /* table is now an ARRAY [-1..128] OF CHAR, in Pascal * terminology. */ ------------------------------------------------------ Chris Miller