Are all data pointers the same size in one platform for all data types?

前端 未结 8 855
太阳男子
太阳男子 2020-11-22 16:33

Are char*, int*, long* or even long long* of same size (on a given platform)?

8条回答
  •  北海茫月
    2020-11-22 17:04

    Not necessarily. The standard does not guarantee sizeof(double*) == sizeof(int*). For instance, assume a processor with two address buses with different widths (like on some Harvard architecture processors) it could have pointers with different sizes.

提交回复
热议问题