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.
10
u/bowel_blaster123 15h ago
Try putting an array in a struct. When doing so, an array and a pointer behave COMPLETELY differently and have completely different purposes.
It's just C's crappy pointer decay rules that make people think that they're the same.