The result would be 64.
void main(){ int i=320; char *ptr=(char *)&i; printf("%d",*ptr); }
Suppose address of i, i.e &i = 1000 meaning that 320 is stored in the memory location 1000H.
An integer requires 4 bytes, so 320 would be stored in memory in the following manner --
| < 1003 > | |< 1002 > | |< 1001 > | | <1000 > | --> Memory locations
0000 0000 0000 0000 0000 0001 0100 0000 --> binary representation of 320
The character pointer ptr contains the address of "i" , i.e., 1000H.
Also a character pointer can fetch only 1 byte at a time.
So considering the 0th byte --> 0100 0000 gives 64.
Hope this helps.