c - Passing arrays vs structures to functions -
in c, arrays passed functions pointers. structures can passed functions either value or address (pointer). there specific reason why can not pass array value can pass structre value ?
in c, everything passed value. there rule says in contexts, name of array equivalent pointer first element. passing array function such context.
so, special case not arrays passed reference, special case the rule arrays decaying pointers. gives 1 impression array passed reference (which is, know why!)
the post in link above explains in more detail type of array in different contexts.
Comments
Post a Comment