In C program I'm doing below stuff
int x = 4;
Let us assume integer has 2 bytes in this case. So my question here is the variable x will hold two bytes that mean 16 bits. So here how the value 4 will be stored in 16 bits ?
Till now my understanding is the value 4 will be converted to Hex so it results [0x0004] and this hex value is stored in the 16 bit boxes ?
I dont know whether my understanding is correct but I need how the value of the x is mapped to 16 bit boxes ? It would be good if anyone provide structural/graphical representation about storing values in memory.