i found this code in a book. i am finding it confusing.
#include<stdio.h>
int main()
{
int arr[3]={2,3,4};
char *p;
p = (char*)arr; // line A
p = (char*)((int*)p);
printf("%d",*p);
p= (char*)(p+1); //line B
printf("%d\n",*p);
return 0;
}
the answer is: 2 0
but i cant figure out how/why that '0' gets printed
in line A does 'p' point to 2 or a garbage value?? (since p is a character pointer)
and what is line B doing??