Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:That's a good point. It's not just arrays that can't be passed by value (because the language says so) but also functions (because its not meaningful).
I earlier asked this:They aren't. C allows lots of things to be passed as an argument
>
"So if arrays aren't passed by value in C, and they aren't passed
by reference, then how the hell ARE they passed?!"
to a function: several varieties of numeric values, structs,
unions, and pointers, including both pointers to object types and
pointers to function types. C does not have a way for a function
to take an argument that is either an array or a function. There
is a way to take pointers to those things, but not the things
themselves. Arrays and functions are second-class values in C.
Les messages affichés proviennent d'usenet.