Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site tjalk.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!mcvax!vu44!botter!tjalk!cogito From: cogito@tjalk.UUCP (Robbert van Renesse) Newsgroups: net.lang.c Subject: Re: array refs Message-ID: <415@tjalk.UUCP> Date: Sun, 13-Jan-85 07:29:52 EST Article-I.D.: tjalk.415 Posted: Sun Jan 13 07:29:52 1985 Date-Received: Tue, 15-Jan-85 01:09:58 EST References: <7225@brl-tgr.ARPA> Reply-To: cogito@tjalk.UUCP (PUT YOUR NAME HERE) Organization: VU Informatica, Amsterdam Lines: 24 Summary: In article <7225@brl-tgr.ARPA> cottrell@nbs-vms.ARPA writes: >/* >i disagree about referencing arrays 'out of bounds'. i have often taken >a pointer, moved it down the array, when suddenly i find i have to >pervert the previous character. what do i do? something like: p[-1] = ... ; I see nothing wrong with negative indexing either, on the contrary, it is very useful when you want to have all the arguments of main in one string: main(argc, argv) char *argv[]; { register i; for (i = 2; i < argc; i++) argv[i][-1] = ' '; do_it(argv[1]); } What did you say? Portability? Don't be a bore. -- Robbert van Renesse ...!{decvax|philabs|seismo}!mcvax!vu44!cogito