Is it safe to assume that a pointer is the size of an int in C?

前端 未结 7 920
别那么骄傲
别那么骄傲 2020-12-20 16:52

In designing a new programming language, is it safe to assume that a C int and a pointer are the same size on the machine?

7条回答
  •  萌比男神i
    2020-12-20 17:21

    I believe the Linux Kernel passes pointers as unsigned long's. They are guaranteed to be at least the same size as a pointer :)

提交回复
热议问题