J
joshc
So I've read the relevant sections in the FAQ and the other threads on
this topic but didn't find the exact answer to my question. A fellow
developer wrote the following in some code:
uint16 arr[10];
uint16 val;
val = *(&arr + 0);
So I know that &arr is a pointer to an array of 10 ints versus arr
which is a pointer to int when used in value context. In my case my
compiler ended up storing the address of 'arr' in 'val' for the code
above. Can someone explain what really happens in the code snippet
above? In other words what the (&arr + 0) expression evaluates to in
terms of type, etc.
Thanks.
this topic but didn't find the exact answer to my question. A fellow
developer wrote the following in some code:
uint16 arr[10];
uint16 val;
val = *(&arr + 0);
So I know that &arr is a pointer to an array of 10 ints versus arr
which is a pointer to int when used in value context. In my case my
compiler ended up storing the address of 'arr' in 'val' for the code
above. Can someone explain what really happens in the code snippet
above? In other words what the (&arr + 0) expression evaluates to in
terms of type, etc.
Thanks.