by pqomdv · 11y ago · 0 comments
You probably though of:
array == &array[0]
which is always true.This:
(void*)&array == (void*)&array[0]
which simplifies to: (void*)&array == (void*)array
is not.C doesn't guarantee that the values of &array and array are the same. The types T( * )[ * ] and T* are not even compatible and those two pointers are allowed to have different sizes and representation.
This relationship is also true between a pointer to a struct and a pointer to the first element. And also among pointers to the elements of a union.