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.

Message-ID <4FC27072.638B@mindspring.com> (permalink)
Date 2012-05-27 14:20 -0400
From pete <pfiland@mindspring.com>
Organization PF
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>

Show all headers | 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