I have written the below code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int *p=(int *)malloc(sizeof(int));
*p=0x8F7E1A2B;
printf("%x\n",*p);
unsigned char *q=p;
printf("%x\n",*q++);
printf("%x\n",*q++);
printf("%x\n",*q++);
printf("%x\n",*q++);
return 0;
}
The output of the code is as shown below:
8F7E1A2B
2B
1A
7E
8F
Can anyone please explain the output of this code. Thanks in advance.