Array base address = ‘a’

 
uint64_t a[2] = { 0 };
//
// To access the second element of the array 
// we can take the index * size of an element.
//
*(uint64_t*)(a + (1 * sizeof(uint64_t))) = 10;
//
// The above is the same as doing this.
//
a[1] = 10;
 
// ----------------------------------------------------------------------------------
 
a = base of array = 00 (like diagram)
//
// Access first element
//
*(u64*)(a + (0 * sizeof(u64))) // => *(u64*)(a + 0) => read 64-bit integer @ base of 'a' (address 00)
//
// Access second element
//
*(u64*)(a + (1 * sizeof(u64))) // => *(u64*)(a + 8) => read 64-bit integer @ base of 'a' + 8 (address 08)

🌱 Back to Garden