Please explain output
as int is of 4 byte and char is of 1 byte and u explicity convert b into char * and refer to a char pointer
so if u do x[0] then it will add on the last bit
for more understanding
do
int *p=&b
p[0]=2
output will be 2
as the pointer is of same type so it change the
whole but char is of only 1 byte so it will change only 1 byte portion u can say
hope this help
please explain this conept on this ques how we got the ans
as pointer has the address of variable so char pointer only have the address of last bit of the integer u r pointing explicitly so x[0] means only change the last bit as x is pointing to that memory only
x[1] has no relevencre