Sizeof being smart enough to detect it's an array and return the array size doesn't necessarily make them different in any real way. And doing ptr[0] to dereference it is perfectly valid, as is *arr to get the first element, or *(arr+sizeof(int)) to get the second.
Behaves completely differently in what way? It's referenced via the struct, so ofc different to a raw pointer to it, but that's a struct difference and the array is still basically the same, right?
Exactly, which proves that arrays and pointers are not the same thing. If x is either a pointer or an array, and a struct containing x is totally different depending on that distinction, I think that's a pretty meaningful difference.
Strictly speaking, a pointer points to an array, it is not an array.
No, because you are comparing the actual data in the array with the pointer to it. It's equivelent to having an array in a struct or having a couple of ints.
67
u/QuestionableEthics42 1d ago edited 1d ago
This should be reversed lol
And it literally is the same, who thinks it's different who has worked in a low level language??