It's casting b, which is an integer, to a char*, then casting a, which is an array but taken as a char* in this context, to an integer, then using pointer[offset] syntax to address the 'd'.

pointer[offset] is just worked out as pointer+offset*sizeof(*pointer) so there's no difference between a[b] and b[a], providing b and a in the latter case are cast correctly.