I'm new to dealing with Macros and I've just stumbled into an exercise that I can't figure it out. Could someone explain to me what's happening here? If I compile i can see what the output is but i can't get it there myself. Thank you in advance!
#define M(varname, index) ( ( (unsigned char*) & varname )[index] )
int main(void) {
int a = 0x12345678;
printf( "%x %x\n", M(a,0), M(a,3) );
printf( "%x %x\n", M(a,1), M(a,2) );
}