How much memory do pointer variables take?
The size of pointers are not fixed by the C or C++ standards. They can vary between different implementations of C and C++ compilers. However, you will find that size of pointer often corresponds to the bit-architecture of target machine. That is, if the compiler is for 32 bit architecture, then the pointer would occupy 32 bits (4 bytes), and if the compiler is for 64 bit architecture, then the pointer would occupy 64 bits(8 bytes). This is not made by any rule, but just a convention for addressing Words. In theory, different pointer types may occupy different number of bytes. So do not ever assume a particular size for pointers, instead you should just use the
sizeof operator every time you need to find the size of any pointer.
Additional Note: Size of a byte(according to C standard) is not fixed to 8 bits. This can vary as well between different implementations.
CategoryPointers