Re:Everything I wish I knew when learning C
by yakubin on Monday November 28, 2022 @07:40PM
(#33782085)
They’re not pointers. sizeof a == 4*sizeof(int), not sizeof(int*).
[ Parent
| on HN ]
Re:Everything I wish I knew when learning C
by chipsa on Tuesday November 29, 2022 @09:48AM
(#33788237)
They're pointers, just weird ones. The compiler knows it's an array, so it gives the result of the actual amount of space it takes up. If you passed it into a function, and used the sizeof operator in the function, it'd give `sizeof(int *)`. Because sizeof is a compile-time operation, so the compiler still knows that info for your example.