I am new to pointers in C. Please help me with following code:
void main()
{
int i=3;
printf("unsighed Address of i = %u \n",(unsigned int)&i);
printf("int Address of i = %d\n",(int)&i);
printf("pointer Address of i = %p\n",&i);
printf("Value of i = %d\n",i);
}
Output:
unsighed Address of i = 3219915640
int Address of i = -1075051656
pointer Address of i = 0xbfec0378
Value of i = 3
As you can see, I am just checking address of i
through int
, unsigned int
, and pointer. Unsigned and pointer values are same (0xbfec0378 of base16 = 3219915640 of base10).
But integer value is different. int range is (-32768 to 32767). So I don't know how I got -1075051656. Can you explain this.