Re:C’s Biggest Mistake
by senkora on Sunday July 02, 2023 @07:24PM
(#36566880)
Your link points out that this decays to a raw pointer in all cases and is not enforced by the compiler.
[ Parent
| on HN ]
Re:C’s Biggest Mistake
by joshuaissac on Tuesday July 04, 2023 @03:51AM
(#36583566)
It does not. The decay is for the arr[size] form.
> using the int array1[2]; like this: arraytest(array1); causes array1 to automatically decay into an int .
> HOWEVER, if you take the address of array1 instead and call arraytest(&array1), you get completely different behavior!
> Now, it does NOT decay into an int