Let's say we have an array
char arr[10]
Why are these not the same? gdb outputs different address.
display/w &arr[10] - /x &arr+10 = 0x7ffc85c8b9f4
display/w &arr+10 - /x &arr[10] = 0x7ffc85c770f9
I understand these as
- The address of the tenth element of arr.
- The address of the tenth byte of arr, where a char is 1 byte.