From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 6 Aug 2004 15:06:13 -0400 From: Chunky Kibbles To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] rc mystery Message-ID: <20040806190613.GE460@gamehenge.icculus.org> References: <20040806181754.GA460@gamehenge.icculus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Topicbox-Message-UUID: d27412c6-eacd-11e9-9e20-41e7f4b1d025 On Fri, Aug 06, 2004 at 11:47:09AM -0700, Skip Tavakkolian wrote: > > OK. So I guessed the right answer on the grounds that it's the only > > sensible answer [assuming the code is genuinely correct], but would > > someone please explain it to me anyways? > > Why, indeed. I've been replied to in person a couple times, now, which I greatly appreciate. Basically, x[y] is shorthand for *(x+y). Recall that in pointer arithmetic, "+" is commutative. ie, the compiler reduces it to ("unix" + 0), which is a pointer to the u. Gary (-; PS It should also be accompanied with a #warning Code written by perl "programmer"