#include <stdio.h>
union new {
char c;
int i;
};
int main() {
union new data;
data.i = 0x12345678;//4bytes
printf("%x\n", data.i);
data.c = 0xa5;//here since 1 byte allocates a last on top of the 4int bytes
printf("%x\n", data.i);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: