Because the pointer is not a reference;). It is not a value, it is just an address in memory. When you check the value of a pointer, it will be a number, possibly large and not related to the actual value that is stored in this memory location. Say printf("%p\n", a); prints "2,000,000" - this means that your pointer points to the 2,000,000th byte in your machine memory. He almost does not realize what value he stores there.
Now the pointer knows what type it points to. An integer in your case. Since the integer is 4 bytes long, when you want to go to the next "cell" that the pointer points to, it should be 2000004. This is more than 1 integer further, so a++ makes sense.
BTW, if you want to get 42 (from your example), print the value indicated by: printf("%d\n", *a);
Hope this makes sense;)
source share