I have the below program in C:
main() {
int arr[5]={100,200,300};
int *ptr1=arr;
char *ptr2=(char *)arr;
printf("%d\n",sizeof(int));
printf("%d %d",*(ptr1+2),*(ptr2+4));
return 0;
}
Its output is as follows:
4
300 -56
Please explain the last output. As per my understanding the last output should be 44 rather than -56.
44?endianness300, which is stored as44, 1.