o/p:Code:int main() { char a[]={1,2,3,4,5}; char *cp; int *ip; clrscr(); cp = a; ip=(int*)cp; printf("%d \n",*(cp+2)); printf("%d \n",*(ip+1)); }
3
1027
The o/p value 1027 is because as pointer ip is a pointer to an int(if size of int is 2 bytes) then it will print the value 0x0304.
what is the output of ( printf("%d \n",*(ip+1)) if it is little endian and what is the output if it is big endian machine?