Path: csiph.com!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Thu, 11 Aug 2016 13:54:45 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Difference between these pointer syntaxes References: <8737mdh47k.fsf@bsb.me.uk> Date: Thu, 11 Aug 2016 19:54:45 +0100 Message-ID: <87bn0zb0ga.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:lZWCiH3RGUidPZA947QDstbI/4E= MIME-Version: 1.0 Content-Type: text/plain Lines: 19 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-erIZewfpe6pgWe4pzzkdxsbHj2Bou6YgIdPeAk/JbXxEDrL6CT83H1nRjDzdFBqLqOOD34p4lwuIv44!hw6W2D5UnuYw53/Je0UV2TDYvEaJH7PdnR2JWS1rvVT2uQeCWyTkWSNcfr0HsiSGFZN2zA== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1557 Xref: csiph.com comp.lang.c:92147 Ben Bacarisse writes: > eva galois writes: > >> Could someone explain (compiler and/or assembly level) differences >> between *(arr[i]) and (*arr)[i]? I'm interested in how they are evaluated. > [Snip comprehensive reply] > The equivalence of E1[E2] and *(E1+E2) also means that *E can be written > as E[0]. Thus your two examples are > > arr[i][0] and arr[0][i] > > which, as you can see, shows that both could be seen as accessing a 2D > structure of some sort. Neat observation. I shall remember that.