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


Groups > comp.lang.c > #7161

Re: References discussion

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: References discussion
Date 2011-06-29 07:43 +1200
Message-ID <96up7uFfpqU1@mid.individual.net> (permalink)
References <iud02j$o39$1@speranza.aioe.org>

Show all headers | View raw


On 06/29/11 04:38 AM, jacob navia wrote:
> I would like to thank all people that participated in that discussion.
>
> I have learned interesting points that I did not even consider before
> (thanks to Shao for pointing out that references could bypass the
> "array decay" problem and pass size information into the called
> function)
>
> I discovered quite a few bugs in my implementation, that I am correcting
> now.
>
> Ian discovered that there was an incompatibility between my
> implementation and the C++ behavior. I build a constant reference
> object without *requiring* that the reference is declared as "const"...
>
> I do not see really the problem but will change this to remain
> compatible with C++.

 From Tim Rentsch's post, something like

void foo( int& x )
{
   ++x;
}

int n = 42;

foo( n );

foo( n++ );  // What is the resulting value of n?

-- 
Ian Collins

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


Thread

References discussion jacob navia <jacob@spamsink.net> - 2011-06-28 18:38 +0200
  Re: References discussion Ian Collins <ian-news@hotmail.com> - 2011-06-29 07:43 +1200
    Re: References discussion jacob navia <jacob@spamsink.net> - 2011-06-28 21:59 +0200
      Re: References discussion Jens Gustedt <Jens.Gustedt@loria.fr> - 2011-07-02 09:51 +0200

csiph-web