How many bytes do pointers take up?

Viewed 63593

I am little bit confused about pointers and how many bytes they take up. In my textbook it first says that pointers on 16 bit systems take up 2 bytes, 32 bit systems 4 bytes, 64 bit system 8 bytes and so on. Then 10 lines after, it says that pointers take up that many bytes, that are needed to hold the addresses. Here are my questions :

  1. So does this mean that if we are lets say on 64 bit system, address will need at most 8 bytes?
  2. If we are on 16 bit system and pointers take 2 bytes, and address needs more the 2 bytes to be placed then what happens?
6 Answers

I will try to give you a rough idea. But there are exceptions to the "rule".

  1. So does this mean that if we are lets say on 64 bit system, address will need at most 8 bytes?
  • Yes if it is a 64bit system, it means that (in most cases) there are 64bit representing the RAM Main Memory Addresses.
  1. If we are on 16 bit system and pointers take 2 bytes, and address needs more the 2 bytes to be placed then what happens?
  • I assume you refer at allocating memory cells. If that is the case, then you can allocate as much memory as you like, this will not be a problem. For example if your system has a 16bit Pointer Address then you can allocate 512bits.
Related