size of pointer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shanthisagar
    New Member
    • Sep 2007
    • 4

    size of pointer

    Is the size of the pointer fixed or not?

    Does the size of the pointer depends on the parameters like 16-bit compiler or 32-bit compiler?
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by shanthisagar
    Is the size of the pointer fixed or not?

    Does the size of the pointer depends on the parameters like 16-bit compiler or 32-bit compiler?
    For a given platform (computer) and a given compiler, the size of a pointer is fixed.
    There are a lot of different computers out there and a lot of different compilers so
    expect to find a lot of different pointer sizes.

    The 16-bit and 32-bit name suffixes don't say much about the size of a pointer;
    e.g. the good ol' AS/400 has a 32 bit wide processor but pointers can be as
    large as 256 bits.

    kind regards,

    Jos

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Adding to what JosAH has said, I would like to add that a pointer is just a variable. However, it is a variable that can only contain an address. Since addresses for a given operating system are all the same length, the pointer variables are all the same size.

      Comment

      Working...