Comment

Comment by pqomdv

Which definition is that?

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.

parent pqomdv 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton