Monday, 25 September 2017

c++ - size of pointers and architecture

By conducting a basic test by running a simple C++ program on a normal desktop PC it seems plausible to suppose that sizes of pointers of any type (including pointers to functions) are equal to the target architecture bits ?




For example: in 32 bits architectures -> 4 bytes and in 64 bits architectures -> 8 bytes.



However I remember reading that, it is not like that in general!



So I was wondering what would be such circumstances?




  • For equality of size of pointers to data types compared with size of pointers
    to other data types

  • For equality of size of pointers to data types compared with size of pointers

    to functions

  • For equality of size of pointers to target architecture

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...