Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #21420

Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc.

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Sun, 27 May 2012 13:20:40 -0500
Message-ID <4FC27072.638B@mindspring.com> (permalink)
Date Sun, 27 May 2012 14:20:34 -0400
From pete <pfiland@mindspring.com>
Reply-To pfiland@mindspring.com
Organization PF
X-Mailer Mozilla 3.04Gold (WinNT; I)
MIME-Version 1.0
Newsgroups comp.lang.c
Subject Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc.
References <d8247fad-17c7-4105-82c1-364f00dac222@p27g2000vbl.googlegroups.com> <jptq6q$27g$1@dont-email.me>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Lines 27
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 4.154.221.107
X-Trace sv3-KulJgwrIyJWLUgv5m82tUyeLNVFmoUAV5rVA+oTSy0hW681ZIdD9Iy7gfnxTQeWzIK1JcQpGvw2K5GK!3bZ9PuSWPi5P9e5b5T4HNC/C72wprP60c1CZdxEvVpLxh/EMYjwQrYEyKG2AaToLgOwb61ziUn+o!teQFJ3zDfBE=
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 1908
Xref csiph.com comp.lang.c:21420

Show key headers only | View raw


Eric Sosman wrote:
> 
> On 5/27/2012 1:30 PM, John Reye wrote:
> > Hi!
> >
> > In writing code I often find numerous ways of expressing the same
> > thing.
> > I have some questions of "style" and "optimization" that I'd like to
> > ask.
> > [...]
> > (*) - what do you think?
> 
>      I think this is Question 20.14 on the comp.lang.c Frequently
> Asked Questions (FAQ) page, <http://www.c-faq.com/>.

I think John Reye's question was more about
whether to use a const qualified variable (pst) 
in a function 
to hold the sum of two variables (st + i),
when the sum was going to be used frequently
and the values of the two variables 
were not going to change within the function.

I would be inclined to use a const qualified variable in such a case.

-- 
pete

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. John Reye <jononanon@googlemail.com> - 2012-05-27 10:30 -0700
  Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. John Reye <jononanon@googlemail.com> - 2012-05-27 10:35 -0700
    Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. pete <pfiland@mindspring.com> - 2012-05-27 14:11 -0400
  Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-05-27 14:01 -0400
    Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. pete <pfiland@mindspring.com> - 2012-05-27 14:20 -0400
  Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. Thomas Richter <thor@math.tu-berlin.de> - 2012-05-27 22:03 +0200
    Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. Johannes Bauer <dfnsonfsduifb@gmx.de> - 2012-05-28 14:54 +0200
  Re: Array addressing styles: arr[i].d[j] versus pArr->d[j], etc. Tim Rentsch <txr@alumni.caltech.edu> - 2012-05-31 13:09 -0700

csiph-web