I'm learning C and I saw this code but I can't tell the difference. Can someone explain this please ? Thanks.
#include <stdio.h>
int main(int argc, char const *argv[])
{
int addressAsInt = 0x61FF08;
printf("address = %p\n", addressAsInt);
int address2AsInt = 0x61FF14;
printf("address2 = %p\n", address2AsInt);
printf("rest = %d\n", address2AsInt - addressAsInt);
int* address = (int*) 0x61FF08;
printf("address = %p\n", address);
int* address2 = (int*) 0x61FF14;
printf("address2 = %p\n", address2);
printf("rest = %d\n", address2 - address);
return 0;
}
The first difference outputs 0000000C and the second 00000003. I understand the first one but not the second.