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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -