"Steve Mann" <[EMAIL PROTECTED]> wrote in message
news:52855@palm-dev-forum...
>
> At 1:23 AM -0500 6/13/01, Ben Combee wrote:
>
> >Actually, if you have an array, &name is the same as name.  See ISO C
> >(1999), $6.3.2.1 part 3, array names get converted to pointers except
> >when used with sizeof or the '&' operator.
>
> Thanks Ben. I learn something new every day. My comment is based on
> the C++ compiler complaining every time I accidentally do that.
>

Great ... enough people make a misteak and it becomes codified.

Even though the standard apparently allows "&name", it is counterintuitive
to people who are aware of how the address-of operator works since it
is essentially an exception to the normal operation of the operator.

Not to mention whether or not the compiler implements ISO C, 1999 edition.
And even if this one does, will the next one you use?

I'd stick w/ the unadorned array name and/or explicitly taking the
address of the zeroth element.

btw: ok, so this is in the C standard ... but Steve mentions the C++
compiler complaining, can somebody check the latest C++ standard
and see what it has to say on the subject?  If C standard says it
supports this abuse, but the C++ standard doesn't ... do you really
want to get into the habit of using it?

(gee, I can get grouchy in the morning before I have my tea ...)

--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to