I saw something like this but I can't remember where
it was successfully compiled using gcc with "-Wall", "-W", and "-pedantic" options.Code:#include <stdio.h> int main (void) { const unsigned int var = 0xabcd1234; printf("%x\n", var); ((unsigned char *)&var)[0] = 0xff; printf("%x\n", var); return(0); }
why does it work? I don't understand.
is it one of what they say about C that "you can shoot your own foot" or something like that?