Afficher un message
Vieux 21/10/2007, 19h48   #7
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof and passing pointer

jason <jisis@notmal.com> writes:
[...]
> But just to make sure; what does `decay' exactly mean in this case ? And
> what properties of the pointer, when passed to a function actually
> change ?


It's really not about argument passing.

An expression of array type is implicitly converted to a pointer to
the first element of the array *unless* it's the operand of a unary
"&" or "sizeof" operator, or it's a string literal used in an
initializer for an array.

All this and more is explained in section 6 of the comp.lang.c FAQ,
<http://www.c-faq.com>.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Réponse avec citation
 
Page generated in 0,05510 seconds with 9 queries