subramanian a écrit :
I have been thinking that all pointers(to any obejct) have the same
size. The size of a pointer is the size of an int. This is beause a
memory location is addressed by an int. Is that right/wrong?
No.
It is true that memory locations are integers, in some
machines a sequence of integers that refer to sequential
memory locations x, x+1, x+2, x+3, etc.
The "int" data type can be different from those integers,
much smaller, for instance. This is common in small
processors, where you have a big ROM and a small RAM amount.
There, pointers can be much bigger (24 bits or 32 bits) than
integers, since pointers must address the ROM.
Besides, not all pointers are equal, since you can have pointers to ram
that will fit in 16 bits, for instance, and pointers to ROM, that
need 24 bits, and pointers to some EPROM that will be 32 bits,
since the addresses of those areas were designed like that
in the circuit board.