Sujet : Re: technology discussion → does the world need a "new" C ?
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 10. Jul 2024, 16:54:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6mas4$1v1rh$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Mozilla Thunderbird
On 10.07.2024 16:49, bart wrote:
...
"So if arrays aren't passed by value in C, and they aren't passed by
reference, then how the hell ARE they passed?!"
The problem with that question is the same as the problem with the
question "How are Justices of the US Supreme Court elected?". They
aren't elected, so the question cannot be answered. Arrays cannot be
passed in C, so the question of how they are passed also cannot be answered.
You can pass a pointer to the start of an array or a pointer to the
whole array; either way, the pointer is passed by value. You could also
pass a struct containing an array; that struct is passed by value.