If we have to hold an address of any data type then we require a pointer of that data type.
But a pointer is simply an address, and an address is always int
Pointers are not just int
. They implicitly have semantics.
Here are a couple of examples:
p->member
only makes sense if you know what type p
points to.
p = p+1;
behaves differently depending on the size of the object you point to (in the sense that 'p' in in fact incremented, when seen as an unsigned integer, by the size of the type it points to).